oracle where 条件中用case

select  
 substr(xoq.item,2,5) model
from xwp_out_quantity xoq
where xoq.vendor='&s_vendor'
and (case when xoq.vendor='220010' then substr(xoq.item,2,1) else null end)=9
or  (case when xoq.vendor='220020' then substr(xoq.item,2,1) else null end)=8
or  (case when xoq.vendor='220030' then substr(xoq.item,2,1) else null end)=7

你可能感兴趣的:(oracle where 条件中用case)