6 days ago · COUNT() function with distinct clause. SQL COUNT() function with DISTINCT clause eliminates the repetitive appearance of the same data.
People also ask
How to count unique values in SQL?
How to get unique values in SQL?
Does count count distinct in SQL?
Oct 5, 2009 · What you want is COUNT(DISTINCT <expression>) : evaluates expression for each row in a group and returns the number of unique, non-null values.
To count the number of different values that are stored in a given column, you simply need to designate the column you pass in to the COUNT function as DISTINCT ...
The COUNT DISTINCT function returns the number of unique values in the column or expression, as the following example shows. SELECT COUNT (DISTINCT item_num) ...