I need to do the following:
Say I have a table with 1 column with the following data:
Col1
----
b
a
c
a
d
a
e
f
d
c
I want to be able to count how many unique entries there are for only a,b & c
ie, the answer I want is 3, as there is at least 1 a, 1 b and 1 c.
Its pretty trivial just looking at it but I am after a SQL command to do it.
if I do the following:
select count(*)
from table
where col1 in ('a','b','c')
I end up with 6 as it double counts the duplicates.
Thanks
B.
Say I have a table with 1 column with the following data:
Col1
----
b
a
c
a
d
a
e
f
d
c
I want to be able to count how many unique entries there are for only a,b & c
ie, the answer I want is 3, as there is at least 1 a, 1 b and 1 c.
Its pretty trivial just looking at it but I am after a SQL command to do it.
if I do the following:
select count(*)
from table
where col1 in ('a','b','c')
I end up with 6 as it double counts the duplicates.
Thanks
B.