GROUP BY

Breaks all records into groups

SELECT category, COUNT(category) FROM People GROUP BY category

The SQL Statement above will retrieve

category and number of records in each category: SELECT category, COUNT(category)

From the table named People: FROM People

broken down by category:GROUP BY category



If this is the original table
People
FNameLNameCategory
JohnSmith1
AlJones2
FredAdkins1
FredSmith1
JeffAdkins2
TonyRoma1
EdHabal2


Your recordset returned would be this:
categorycount
14
23



Come learn HTML or Classic ASP in Honolulu, Hawaii!

HOME | SQL Tutorials | XML Tutorials | OKIWEB | EMAIL ME | ASP Alliance