SQL case when else

先占个坑,sql 版本的swith case

SELECT Oldvote,
(CASE 
WHEN Oldvote=1 THEN  (SELECT NOW()  from dual)
WHEN Oldvote=2 THEN 1
WHEN Oldvote=0 THEN 3
ELSE 3
END) as "number"
FROM dual ;

 

posted @ 2014-12-10 19:44  KeithMorning  阅读(174)  评论(0编辑  收藏  举报