oracle根据某个字段的值进行排序

需求:按照颜色为蓝色、红色、黄色进行排序:

order by  case
                  when color = '蓝色' then
                   1
                  when color = '红色' then
                   2
                  when color = '黄色' then
                   3
                end

如果根据多个字段进行排序,在字段之间加逗号,分割  就行。

posted @ 2019-03-20 14:06  今夜有点儿凉  Views(8537)  Comments(0)    收藏  举报