May 2020
Beginner
564 pages
14h 9m
English
To order results by one column using ORDER BY, you can use the following sample syntax. The WHERE clause is optional:
SELECT col1, col2, col3FROM tableWHERE condition(s) ORDER BY col1;
To order results by multiple columns using ORDER BY, you can use the following sample syntax. The WHERE clause is optional:
SELECT col1, col2, col3FROM tableWHERE condition(s) ORDER BY col2, col1;
To order results in descending order using ORDER BY, you can use the following sample syntax. The WHERE clause is optional:
SELECT col1, col2, col3FROM tableWHERE condition(s) ORDER BY col2 DESC, col1 DESC;
Read now
Unlock full access