Reputation: 3560
Let's say I have a table of a few hundred names and ages. I want to query the 100 youngest people like
SELECT name, age FROM people ORDER BY age ASC LIMIT 100
But what if I wanted the results to come back sorted by name? Is there an easy way to do that?
Upvotes: 0
Views: 35
Reputation: 57774
The syntax is probably wrong here, but it is something along the lines of:
SELECT * FROM
(SELECT name, age FROM people ORDER BY age ASC LIMIT 100)
ORDER by name
Upvotes: 4