六狼论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

搜索
查看: 30|回复: 0

基于dual 有意思的decode和case-when-then-else-end的测试

[复制链接]

升级  50%

5

主题

5

主题

5

主题

童生

Rank: 1

积分
25
 楼主| 发表于 2013-1-27 05:07:55 | 显示全部楼层 |阅读模式
select  decode( op
                ,'a','hht,I am A; b is the base! and It is not a lie , '
                     ||'please believe me;I promise!'
                ,'b','hht,I am B; a is the base! and It is not a lie , '
                     ||'please believe me;I promise!'
                ,'c','I am not allow to tell you anything, sorry-ing......'
                ,'none') dcde
from (
     select case in_op
            when 'a' then 'b'
            when 'b' then 'a'
            else 'c'
            end op
             from (
                  select 'a' in_op
                  from dual
                  )
     )
您需要登录后才可以回帖 登录 | 立即注册 新浪微博账号登陆

本版积分规则

快速回复 返回顶部 返回列表