使用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

posted on 2018-02-27 16:30  zhucheng88  阅读(227)  评论(0编辑  收藏  举报

导航

Document