Enrollments closing soon for Post Graduate Certificate Program in Applied Data Science & AI By IIT Roorkee | 3 Seats Left
Apply NowLogin using Social Account
     Continue with GoogleLogin using your credentials
By default, select can give rows in any order.
To get the data in order by certain columns, use 'order by'.
Syntax:
select field1, field2,...fieldN table_name1, table_name2...
order by field1, [field2...] [asc[desc]]
select * from deptt order by depcity asc,depstreet desc;
Sorting columns in 'order by' can also be referred to by column position in the 'select' expression rather than actual column names.
In below example, the result will be sorted by 2nd and 5th columns of the output.
select * from deptt order by 2,5;
Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Answer is not availble for this assesment
Loading comments...