使用Oracle 11gSQL:異常,否則便會排序結果集
我想一個例外,否則排序表
select fruit as popluar_choices
from menu
order by fruit /* Exception put 'grapefruit' at top of list */
所需的結果
popular_choices
-----------
grapefruit
apple
fig
kiwi
lemon
pear
它類似於這個帖子: How to apply non standard SQL column sort order?
只有十分開秒鐘,你的答案之間的唯一區別而我的是,我在的情況下使用1和2,而不是0和1。讓我們一起去你的。 – hvd 2012-02-14 21:43:26