I have a table having three columns:
A B C 1 2 2 2 2 2 3 1 1 4 1 2
I want the count of those values which have C equal to 2 but with distinct values of B
So in this case for C = 2, count = 2 (B=2 and B=1)
I used the following command:
Select count(*) from mytable where C=2 group by (B)
but it yields:
count(*) 3
I have tried using "distinct" but it can't be use to select from one column
it can't be use to select from one column- er...