首页 > 代码库 > SQL case when else

SQL case when else

先占个坑,sql 版本的swith case

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

 

SQL case when else