SORTING DATA IN A TABLE:
- The select commands allows user to arrange data in ascending or descending order.
- It can apply to one or more columns.
- To arrange data in sorted order you can use order by clause with select command.
- By default, it will arrange data in ascending order.
- Syntax
- select *
from [where ] order by [ASC | DESC] - Example:
- select * from student where order by city;
- select * from student where order by city, name;
Tags:
DBMS