Oracle的case when 替换字符串

       select

     --姓名(姓名大于四个字的以‘ABC’代替)

        case 

        when length(c.last_name)>5 then 'ABC'

       else last_name

       end 

       as moudle

       from  table1 

 

 

case

      when m.type=1 then 'A'

      when m.type=2 then 'B'

      when m.type=3 then 'C'

      else ''

      end as mem_type 

     from table2  m  --(m为table2别名)

猜你喜欢

转载自yiwozhifeng.iteye.com/blog/1995100
今日推荐