Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
question category A X B Y C X D X E Y
I want to make the output from the most frequent category
question category A X C X D X B Y E Y
You could try with join on the count for category
select m.question, m.category from my_table m inner join ( select category, count(*) num from my_table group by category ) t on t.category = m.category order by t.num desc, m.category, m.question
Add a comment
If you are running MySQL 8.0, you can use window functions for this. This avoids the need for a join.
select * from mytable order by count(*) over(partition by category) desc, question
Use order by category.
select * from [table] order by category
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.