SELECT COUNT(*),city FROM accidents GROUP BY city HAVING COUNT(*)<40 ORDER BY COUNT(*) DESC;
It shows me the cities which are shown under 40 times. But I want to count how many cities there are. So how can I do this with subquery? Please Help me.
Attachments: Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.
Answers Answers and Comments
18 People are following this question.
MYSQL 5.1 Select Statement
When using a static column with SELECT, why can't I access that column from WHERE clause?
Sql Query Rearranging
how to get the difference between two aliases
Distinct and count for same table in a single query.