I’m trying to get the 5 most occurring IDs in my table, my table looks like this:
+-----------+---------------------+---------+---------+
| mashup_id | mashup_time | user_id | deal_id |
+-----------+---------------------+---------+---------+
| 1 | 2011-08-24 21:58:22 | 1 | 23870 |
+-----------+---------------------+---------+---------+
I was thinking of doing a query with a sub-query, something that orders by the count of deal_id? Not exactly sure how to go about it though, if anyone can help, thanks!
In (sort of) generic SQL:
If you meant a different ID field, just substitute it for
deal_id.