+ 1
write SQL query for following To list all the columns of the table 'employee' in ascending order of department number and descending order of salary.
2 Answers
+ 3
SELECT * FROM employee ORDER BY dept_number ASC AND ORDER BY salary DESC;
+ 2
SELECT * FROM employee ORDER BY salary, departmentNumber ASC
or
SELECT * FROM employee ORDER BY salary, departmentNumber
since by default any column after ORDER BY, would be order by ASC
SYNTAX:
-----------
SELECT column-names
FROM table-name
WHERE condition
ORDER BY column-names