Hello,
if I have one table, with two fields, storeid and printed, and I want to select a count of all records grouped by storeid where printed=0 BUT would also like to have the count of all records per storeid where printed=1
Can this be done in a single query?
Example table:
Code:
id storeid printed
1 3 0
2 3 1
3 3 1
4 3 1
5 3 0
6 6 0
7 6 1
8 6 1
Expected result:
Code:
storeid count_printed count_not_printed
3 3 2
6 2 1