I have two tables, one for categories and one for threads.
I want to show all my categories ordered by the number of threads in them. The problem is that I have no idea how to achieve this.
My cats-table:
- idCats
- name
- rules
My threads-table:
- idThreads
- title
- content
- category
- creator
- votes
- created
The category in my threads-table contains the id of the category.
The following query should give you a list of category names and their corresponding thread counts in descending order: