need help for sql COUNT
hi everyone,
i have problem with writing this sql
say i have a table like this:
a b c d
-----------
1 2 1 3
4 2 1 4
1 2 4 3
i want to write a sql to count how many rows(as count1) are (a=1 & b=2) and how many rows(as count2) are (c=1), also group by d
so the result should be:
d=3: count1=2 count2=1
d=4: count1=0 count2=1
how to write this sql??
|