like this:
select
case col
when value then
...
when value1 then
..
else
...
end case
from ...
select
case col
when value then
...
when value1 then
..
else
...
end case
from ...
解决方案 »
- 急救啊!求类似ifelse判断功能的sql写法!!
- 急!请教一条SQl语句
- 各位大哥请帮我看下这个SQL语句出什么问题了?
- select 语句性能问题
- exp/imp, snatshop在oracle online文档的那个地方?
- oracle8i 中is null 和 ='' 一样吗?
- 刚到Oracle版本.准备天天送分:顺便学习,第二个问题:right,在Oracle的写法:
- 如何授权其它用户执行过程。
- ora_01658问题?
- oracle 判断一个字段的值是否包含在另一张表中
- ORA-09817: Write to audit file failed.错误
- 哪儿有oracle的中文函数和语法帮助手册?(GG JJ DD MM发一份给我)
1 insert into temp
2 select 1 from dual
3 union select 2 from dual
4 union select 3 from dual
5*
SQL> /已创建3行。SQL> select case col1 when 1 then '1111' when 2 then '2222' when 3 then '3333' end from temp;CASE
----
1111
2222
3333
SQL>