I have a list of tags in the database.
Example:
villan
hero
spiderman
superman
superman
I wanted to get a sorted list of tag names in ascending order and the number of times a unique unique tag appeared in the database. I wrote this code:
Example:
SELECT hashtag.tag_name
, COUNT( * ) AS number
FROM hashtag
GROUP BY hashtag.tag_name
ORDER BY hashtag.tag_name ASC
This gives the correct result:
hero , 1
spiderman , 1
superman , 2
villan , 1
How can I get the full COUNT of this whole list. The answer should be 4 in this case, because there are naturally 4 lines. It seems I cannot get the correct COUNT () without operator error.
Thank you very much for your help!:)
source
share