multiple order by sql
SELECT * FROM People ORDER BY FirstName DESC, YearOfBirth ASC
multiple order by sql
SELECT * FROM People ORDER BY FirstName DESC, YearOfBirth ASC
order by with more than one column
The following shows that you can perform order by with more
than one column.
'ASC' denotes ascending sort order, but is optional as it is the default sort order.
'DESC' denotes descending sort order
SELECT Id, CompanyName, City, Country
FROM Supplier
WHERE Country IN ('USA', 'Japan', 'Germany')
ORDER BY Country ASC, CompanyName DESC
sql order by multiple columns
SELECT * FROM table_name ORDER BY col1 ASC; -- ASCending is default
SELECT * FROM table_name ORDER BY col1 DESC; -- DESCending
SELECT * FROM table_name ORDER BY col1 DESC, col2; -- col1 DESC then col2 ASC
sort order on two columns sql
Sort by multiple column : ORDER BY column1 DESC, column2
sql order by two columns
ORDER BY column1 DESC, column2
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us