码迷,mamicode.com
首页 > 其他好文 > 详细

两张表数据模糊查询

时间:2019-04-26 12:52:53      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:状态   数据   查询   from   ecc   select   模糊查询   har   bsp   

判断pg_cust_analysis_all表中的’客户名称‘字段是否包含 ICP.dbo.a 表中的ai字段中的数据

eccrc_rep.dbo.pg_cust_analysis_all.客户名称是公司名

ICP.dbo.a.ai是‘ai’发音的汉字

这个需求是计算公司名中包含“爱”同音字

select count(*) from ICP.dbo.a a,eccrc_rep.dbo.pg_cust_analysis_all b where charindex(a.ai,b.客户名称)<>0 and b.客户状态=‘0‘

select count(b.客户名称) from ICP.dbo.a a,eccrc_rep.dbo.pg_cust_analysis_all b where b.客户名称 like ‘%‘+a.ai+‘%‘

两张表数据模糊查询

标签:状态   数据   查询   from   ecc   select   模糊查询   har   bsp   

原文地址:https://www.cnblogs.com/cheng-cheng/p/10773407.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!