试图找到喜欢和不喜欢的替代品(SQL)(Trying to find an alternative to likes and not likes (SQL))
SELECT.....
(v1.PCG like 'n0%'
or
v1.PCG like 'n1%'
or
v1.PCG like 'n2%'
or
v1.PCG like 'n3%'
or
v1.PCG like 'n4%'
or
v1.PCG like 'n5%'
or v1.PCG='N63Af1')
and v1.PCG not like 'N2D%'
and v1.PCG not like 'N2E%'
and v1.PCG not like 'N2C%'
and v1.PCG not like 'N2F%'
and v1.PCG not like 'N2J%'
and v1.PCG not like 'N2K%'
and v1.PCG not like 'N2U%'
and v1.PCG not like 'N2GC%'
and v1.PCG not like 'N2GD%'
and v1.PCG not like 'N2GH%'
and v1.PCG not like 'N2GJ%'
and v1.PCG not like 'N2GK%'
) as 'Value Of PN Orders',
from........
我已经竞争了我的代码,但我想找到一种更有效的方式来做这件事,我看了看但却找不到另一种方式......有什么建议吗?
SELECT..... (v1.PCG like 'n0%' or v1.PCG like 'n1%' or v1.PCG like 'n2%' or v1.PCG like 'n3%' or v1.PCG like 'n4%' or v1.PCG like 'n5%' or v1.PCG='N63Af1') and v1.PCG not like 'N2D%' and v1.PCG not like 'N2E%' and v1.PCG not like 'N2C%' and v1.PCG not like 'N2F%' and v1.PCG not like 'N2J%' and v1.PCG not like 'N2K%' and v1.PCG not like 'N2U%' and v1.PCG not like 'N2GC%' and v1.PCG not like 'N2GD%' and v1.PCG not like 'N2GH%' and v1.PCG not like 'N2GJ%' and v1.PCG not like 'N2GK%' ) as 'Value Of PN Orders', from........I have competed my code but am trying to find a more effecient way of doing this, i had a look but cannot find another way...Any suggestions?
最满意答案
Like支持角色类Like ;
where v1.PCG like 'n[12345]%'Like supports character classes so;
where v1.PCG like 'n[12345]%'更多推荐
发布评论