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
SQL查询:根据供应商筛选特定项号的子字符串
最新推荐文章于 2024-12-12 21:19:08 发布
本文介绍了一个SQL查询语句,用于从xwp_out_quantityxoq表中选择特定条件下的项号子字符串。通过使用CASE WHEN语句,查询能够根据不同的供应商ID筛选出项号的第二到第六个字符,并且提供了多个筛选条件。
577

被折叠的 条评论
为什么被折叠?



