我有以下SQL查询语句:
SELECT subject, sender_list, date, uid FROM messages WHERE folder_id = 3
您能告诉我如何指定查询排序顺序吗?
谢谢你。
实际上很容易。这是一个按“主题”对查询进行排序的示例:
SELECT subject, sender_list, date, uid FROM messages WHERE folder_id = 3 ORDER BY subject ASC
这将订购您的列表AZ。如果要订购列表ZA,请使用:
ORDER BY subject DESC