I would like to double sort my user list. Is this possible within one MySQL query?
- Sort by
activity - Sort by
ID
For example:
1 Jack Active
2 Jill Active
5 Jens Active
3 Harry Inactive
4 Larry Inactive
6 Luke Inactive
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use the
ORDER BYclause to sort as many columns as needed.I would suggest reading the MySQL
ORDER BYdocs. You can sort the data either inASCorDESCorder: MySQL: ORDER BY Optimization