试图找到喜欢和不喜欢的替代品(SQL)(Trying to find an alternative to likes and not likes (SQL))

编程入门 行业动态 更新时间:2024-10-24 21:20:09
试图找到喜欢和不喜欢的替代品(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]%'

更多推荐

本文发布于:2023-07-24 00:19:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1239193.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:不喜欢   替代品   喜欢   SQL   alternative

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!