Is there a way to get the count for each distinct value for a certain field?
for name in (SELECT DISTINCT name FROM table)
SELECT COUNT name FROM table
without using a cursor that is
Is there a way to get the count for each distinct value for a certain field?
for name in (SELECT DISTINCT name FROM table)
SELECT COUNT name FROM table
without using a cursor that is
You may use COUNT()
-- an aggregate function.
SELECT Name, COUNT(*) totalCount
FROM tableName
GROUP BY Name