As of May 31, 2023, we have updated our Code of Conduct.

New answers tagged

5 votes

Not getting the concept of COUNT with GROUP BY?

The COUNT() function is an aggregate function that returns the number of rows in a table. The COUNT() function allows you to count all rows or only rows that match a specified condition. The COUNT() ...
Ergest Basha's user avatar
  • 3,377
1 vote

question regarding count function

You just need to add State to the GROUP BY and your projected columns to get the parent state for each county (e.g. "Florida" for Miami Dade). SELECT state, county, count(*) AS ...
Martin Smith's user avatar
  • 81.3k
1 vote

SQL: Count number of distinct records based on attribute value in an xml

Don't force it into RAM; let it use disk as needed. Do you have it in a table? Or only in XML? There is probably a single LOAD DATA statement to convert that from XML to a table defined thus: CREATE ...
Rick James's user avatar
  • 74.9k

Top 50 recent answers are included