Saturday, November 13, 2010

ORDER BY Clause

Use the 'Order By' clause to sort the data in ascending or descending order.

e.g.

SQL> select first_name,last_name,salary from employees where salary between 1000 and 3000 order by salary;

would display the output in increasing order of salary.

SQL> select first_name,last_name,salary from employees where salary between 1000 and 3000 order by salary desc;

 would display the output with salary in descending order.


Have a question or comment? Post it below!


0 Comments:

Post a Comment