记录一下:
SQL> select case when 10 > 0 then 100 else 0 end from dual;
CASEWHEN10>0THEN100ELSE0END
---------------------------
100
SQL> select case when 10 > 100 then 100 else 0 end from dual;
CASEWHEN10>100THEN100ELSE0END
-----------------------------
0
oracle的SQL里,可根据字段值范围赋予他不同的值,case when与decode类似,但稍有不同,根据上面的例子,可以了解case when的用法,使用case when在某些时候比较方便。
发表于 @
2006年10月10日 11:46:00 | | 编辑|
举报| 收藏