17,377
社区成员
发帖
与我相关
我的任务
分享
select
substr(xoq.item,2,5) model
from xwp_out_quantity xoq
where xoq.vendor='&s_vendor'
and ( ( xoq.vendor='220010' and substr(xoq.item,2,1)='7' )
or ( xoq.vendor='220020' and substr(xoq.item,2,1)='8' )
or ( xoq.vendor='220030' and substr(xoq.item,2,1)='9' )
);
-- 注意数值打上引号,用等于(=),别用 in(7) 的格式!
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