实例 PostgreSQL 按年份对表格进行排序

 
SELECT * FROM cars
ORDER BY year;        
                    

输出结果

 brand  | model   | year
--------+---------+------
 Ford   | Mustang | 1964
 Volvo  | p1800   | 1968
 Toyota | Celica  | 1975
 BMW    | M1      | 1978
(4 rows)