ORDER BY内部的SQL ORDER BY

时间:2015-03-27 13:28:39

标签: mysql sql ms-access

试图抓住SQL

我想按日期排序,然后按照标题排序。

示例:

SELECT *
FROM tblboek
ORDER BY jr_van_uitgave DESC

如何按年龄按订单内的标题订购?

1 个答案:

答案 0 :(得分:1)

试试这个:

  SELECT * 
    FROM tblboek 
ORDER BY age,   -- First order by age
         title  -- if ages are the same, order by title

在您需要时添加DESC,例如如果您想按年龄按降序排序:

  SELECT * 
    FROM tblboek 
ORDER BY age desc,  
         title