Plsql 选择值的pl/sql大小写

Plsql 选择值的pl/sql大小写,plsql,oracle11g,Plsql,Oracle11g,我需要一份来自select的案例陈述,如: select buyer id, buyer_add buyer_city, buyer_state, , case when Special_Desc like "%ma%" then "Mail" when Special_Desc like "%pa%" then "phone" else " " end as Special_Handling from ( select s

我需要一份来自select的案例陈述,如:

select buyer id,
buyer_add
buyer_city,
buyer_state,
 , case
    when Special_Desc  like "%ma%" then "Mail"
    when Special_Desc like "%pa%" then "phone"
    else " "
end as Special_Handling 
         from
            ( select string_func(buyer_id) 
              from advance.pledge p) Special_Desc
from buyer_info
    where..
换句话说,我需要对从Select语句生成的特殊描述执行一个案例


提前谢谢。

您应该这样做:

Hi this is an example which illustrates how to use case within a select statement. I hope this query resolves your problem. Please let me know for any issues. Thanks

SELECT sr_no,
(SELECT
CASE
WHEN UPPER(name)=UPPER('Avrajit') THEN 'My_name1'
WHEN UPPER(name)=UPPER('Shubhojit') THEN 'My_name2'
 END FROM Avrajit
) AS condition
FROM avrajit;
select buyer id,
       buyer_add
       buyer_city,
       buyer_state,
       case
         when regexp_like(s.Special_Desc, 'ma*', 'i') then 'Mail'
         when regexp_like(s.Special_Desc, 'pa*', 'i') then 'Phone'
         else ' '
      end as Special_Handling 
from ( select string_func(buyer_id) 
        from advance.pledge p) s,
     buyer_info
where..

当然,您需要将这两个表关联起来。

我使用case语句中的函数解决了这个问题。 案例 当字符串\u函数g.gift\u捐赠者\u id像“%MA%”时 然后是“邮件” 当字符串\u函数g.gift\u捐赠者\u id像“%MA%”时 然后是“电话” 否则“ 以特殊形式结束


谢谢大家的宝贵帮助。

谢谢,我将这部分内容从您的查询中更改为:从选择字符串\u funcbuyer\u id从advance.质押PS更改为:从选择字符串\u funcbuyer\u id从advance.质押pspecial\u Desc,但现在它告诉我,缺少右括号和所有的父项都是正确的这是我的实际代码,但现在它给了我“缺少右括号,当Sp_Desc像'ma%'然后是'mail',当Sp_Desc像'pa%'然后是'phone'时,其他结束为字符串函数的特殊处理g.buyer_id从gift g作为Sp_Desc你不能使用%,这不是常规表达式,因为%用作通配符