gpt4 book ai didi

mysql - 选择数据库行值是否与一组字符串匹配的有效方法

转载 作者:行者123 更新时间:2023-11-29 08:42:52 27 4
gpt4 key购买 nike

选择数据库行值是否与一组字符串匹配的有效方法

  SELECT id FROM tablename where 
LeadStatus like "%Contact Attempt 1%" or
LeadStatus like "%Contact Attempt 2%" or
LeadStatus like "%Contact Attempt 3%" or
LeadStatus like "%Contact Attempt 4%" or
LeadStatus like "%Contact Attempt 5%" or
LeadStatus like "%Contact Attempt 6%" or
LeadStatus like "%Contact Attempt 7%" or
LeadStatus like "%Call Back/Follow-up%" or
LeadStatus like "%Working%" or
LeadStatus like "%Credit Pulled%" or
LeadStatus like "%Selected other Lender%" or
LeadStatus like "%Pre-Approved%" or
LeadStatus like "%Application Taken/Sent%" or
LeadStatus like "%Application Received%" or
LeadStatus like "%Submitted%" or
LeadStatus like "%Funded%" or
LeadStatus like "%Future Opportunity%" or
LeadStatus like "%Manager Review%"

我想我想要的已经很清楚了?

注意:我无法更改 LeadStatus 值,因为它是从不在我控制范围内的 API 获取的

最佳答案

使用 IN 怎么样?运算符?

这里是 SQLFiddle.com 的示例.

您可以动态构建 CSV 字符串列表,只需将其插入括号之间即可。使用 IN 运算符的唯一缺点是您无法应用通配符搜索(使用“%”)。

关于mysql - 选择数据库行值是否与一组字符串匹配的有效方法,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13272029/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com