How do you sort and limit results?
Model answer
ORDER BY price DESC, name ASC sorts by several columns. LIMIT 10 returns the first ten rows (SQL Server uses TOP, and standard SQL uses FETCH FIRST 10 ROWS ONLY). Always use ORDER BY with LIMIT, or the rows returned are not defined.
Learn this topic
SELECT, FROM and WHERE: Your First Queries in the course SQL for Beginners: Learn Databases Step by Step.
Sign in to add your own answer.