I'm not sure what I need to do here. I think it's probably simple, but my brain's stopped working.
With the following two tables:
tblBasket
idBasket INT PK
basketDate date
tblBasketContents
idBasketContents INT PK
idBasket INT FK
isFree BIT
I want to generate a query that shows a list of tblBasket entries.
Each row in the query resultset should show the basket date, a count of items in that Basket where isFree is 1, and a count of items where isFree is 0.
Do I have to join the table to itself, or does it involve some sort of case statement, or is there another answer?