表1中有a字段 表2中有b字段
如果获得下面的集合
select 1.a from 1,2 where 1.a like 2.b
------解决方案--------------------
可以
不过你这个跟等号没区别
这样
- SQL code
select 1.a from 1,2 where 1.a like '%'+2.b+'%'--orselect 1.a from 1,2 where 1.a like '%'+2.b
------解决方案--------------------
用like 或是用charindex 都可以
------解决方案--------------------
用charindex 吧! 用 LIKE 的话,写的不好容易出错
------解决方案--------------------
对的 用charindex