7.5. 資料排序
SELECT select_list
FROM table_expression
ORDER BY sort_expression1 [ASC | DESC] [NULLS { FIRST | LAST }]
[, sort_expression2 [ASC | DESC] [NULLS { FIRST | LAST }] ...]SELECT a, b FROM table1 ORDER BY a + b, c;SELECT a + b AS sum, c FROM table1 ORDER BY sum;
SELECT a, max(b) FROM table1 GROUP BY a ORDER BY 1;SELECT a + b AS sum, c FROM table1 ORDER BY sum + c; -- 錯誤Was this helpful?