select A.* from A,B where 是A.2=B.1 AND A.3=B.2 AND A.4=B.3 And exists (select 1 from C where C.6 like '%A.1%');
select A.* from A,B,C where 是A.2=B.1 AND A.3=B.2 AND A.4=B.3 and C.6 like '%A.1%'
其实有点手误 A表中的A.1字段和 C表中的C.6字段是like的关系 select A.* from A,B where 是A.2=B.1 AND A.3=B.2 AND A.4=B.3 And exists (select 1 from C where C.6 like '%' + A.1 + '%');这样好象不行啊。没有数据
select * from A where exists (select * from B@zzjj where A.xx=B.xx and A.yy=B.yy and exists (select * from C@zzjj where C.yw='01' and C.xt like '%' + B.xt + '%')); 我这样写为什么不会,不出错但没有数据,但因该是有的啊。
我现在要达到的效果说明就是:就是选出A表中的所有记录,条件是:A.xx=B.xx and A.yy=B.yy 有记录并且A.xx=B.xx and A.yy=B.yy对应出的B.xt这条记录必须存在于C表中,记录存在的方式是比如A.xx=B.xx and A.yy=B.yy 对应的B.xt='01' 在C表中C.xt的数据是01,02,03,04 这样存在的 也就是C.xt like '%' + B.xt '%' 这样如果有记录存在才把A表中符合条件的记录选出来
select A.* from A,B,C where 是A.2=B.1 AND A.3=B.2 AND A.4=B.3 and instr(C.6,A.1)>0
select A.* from A,B,C where 是A.2=B.1 AND A.3=B.2 AND A.4=B.3 and exists (selelct 1 from C where instr(C.6,A.1)>0)
And exists (select 1 from C where C.6 like '%A.1%');
select A.* from A,B where 是A.2=B.1 AND A.3=B.2 AND A.4=B.3
And exists (select 1 from C where C.6 like '%' + A.1 + '%');这样好象不行啊。没有数据
我这样写为什么不会,不出错但没有数据,但因该是有的啊。