Well the title says it all. We can count distinct values such as in
select count(distinct col1) from mytable;
but when we want to count distinct column combinations, we must either clumsily concatenate values (and be very careful to choose the right separator):
select count(distinct col1 || '-' || col2) from mytable;
or use a subquery:
select count(*) from (select distinct col1, col2 from mytable);
So I am looking for something along the lines of:
select count(distinct col1, col2) from mytable;
I don't know whether the SQL standard allows multiple values for COUNT. If not, we might use tuples:
select count(distinct (col1, col2) ) from mytable;
or something similar.