sql, order by column A and then by column B

pierrotlefou picture pierrotlefou · Nov 9, 2009 · Viewed 73.7k times · Source

How to write the sql so that the result can be ordered first by column A than by column B. Something like below:

SELECT * FROM tbl WHERE predictor ORDER by col_A and ORDER by col_B

Answer

James McNellis picture James McNellis · Nov 9, 2009
ORDER BY col_A, col_B

The SQLite website has syntax diagrams explaining the SQL grammar supported by SQLite.