排序 ORDER BY

SELECT * FROM 表名称 ORDER BY 列名称;

DESC 倒序
SELECT * FROM 表名称 ORDER BY 列名称 DESC;

例:
按照 id 正序排列数据表 tb_name
SELECT * FROM tb_name ORDER BY id;

按照 id 倒序排列数据表 tb_name
SELECT * FROM tb_name ORDER BY id DESC;

Comments
Write a Comment