+ -

sql语句用like关联两个表中的字段

时间:2011-06-13

来源:Cbxmm

在手机上看
手机扫描阅读

oracle:

select count(*) from t1,t2 where t1.col1 like '%' ||t2.col||'%';(任意位置匹配) 

同理可有只匹配前或后的

select count(*) from t1,t2 where t1.col1 like t2.col||'%';

select count(*) from t1,t2 where t1.col1 like '%'||t2.col;

热门下载

更多