


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



Order by clause is used with SELECT statement for arranging retrieved data in sorted order. The Order by clause by default sorts the retrieved data in ascending order. To sort the data in descending order DESC keyword is used with Order by clause.
SELECT column-list|* FROM table-name ORDER BY ASC | DESC; Using default Order by Consider the following Emp table, eid name age salary
401 Anu 22 9000 402 Shane 29 8000 403 Rohan 34 6000 404 Scott 44 10000 405 Tiger 35 8000 SELECT * FROM Emp ORDER BY salary; The above query will return the resultant data in ascending order of the salary. eid name age salary 403 Rohan 34 6000 402 Shane 29 8000