TABLE
Col1 Col2 Col3 a 1 Z a 2 Z a null empty b 1 Z b 2 X b 3 Y b 3 Y I want to know the count of distinct values by column.
- Col1 count = 2
- Col2 count = 3 (or 4 uncertain null handling)
- Col3 count = 3 (or 4 uncertain empty handling)
I have been attempting different counting and grouping clauses, but this may be not the way.
SELECT COUNT(DISTINCT col1), COUNT(DISTINCT col2), COUNT(DISTINCT col3) FROM yourtable