当前位置:Gxlcms > 数据库问题 > [SQL] 让特定的数据 排在最前

[SQL] 让特定的数据 排在最前

时间:2021-07-01 10:21:17 帮助过:23人阅读

方法一 select * from tableName ORDER BY case when columnName=张三 then 0 else 1 end asc -- 方法二 select * from tableName where columnName =张三 union all select * from tableName where columnName <>张三

 

[SQL] 让特定的数据 排在最前

标签:

人气教程排行