I have a SQL Server 2008 database with millions of records. One field has values ranging from 0 to 250 and may, or may not, include all numbers witin the range. How do I query the database to get a list of distinct values and the number of records contaiing that value?
I used a Select Count(Distinct) query but that only gives me the number of distinct values.