使用SQL语句进行特定值排序

使用SQL语句进行查询时,对数据进行排序,排序要求为排序的一个字段中特定值为顶部呈现:

select * from TableName
order by 
    case TableFieldName
        when 2 then 1 
    end 
desc    

参考:

https://zhidao.baidu.com/question/62622130.html

http://blog.csdn.net/beyond__devil/article/details/53207847

原文地址:https://www.cnblogs.com/zhucheng88/p/8479610.html