[sql] SQL to find the number of distinct values in a column