I can do a count distinct on one column, but not on two columns.
Code: Select all
dbadmin=> select count(distinct date_key) from sales_fact;
count
-------
1826
(1 row)
dbadmin=> select count(distinct location_key) from sales_fact;
count
-------
1825
(1 row)
dbadmin=> select count(distinct date_key, location_key) from sales_fact;
ERROR 3457: Function count(int, int) does not exist, or permission is denied for count(int, int)
HINT: No function matches the given name and argument types. You may need to add explicit type casts