select A.*,B.列名,C.* from
A,
B,
C
where A.列名 in (select distinct(条件) from 表名 where 条件='XXXXXXXXXX')
结果查询出来的列都没有值,然后去掉C表:
select A.*,B.列名from
A,
B
where A.列名 in (select distinct(条件) from 表名 where 条件='XXXXXXXXXX')
结果查询出来就有值了!
==============
where A.列名 in (select distinct(条件) from 表名 where 条件='XXXXXXXXXX')
这个条件肯定是满足的!
======
请教为什么会出现这种情况??????????????????
...全文
12914打赏收藏
求教一个联合查询的异常问题!!!!!
我有三个表,情况如下: select A.*,B.列名,C.* from A, B, C where A.列名 in (select distinct(条件) from 表名 where 条件='XXXXXXXXXX') 结果查询出来的列都没有值,然后去掉C表: select A.*,B.列名from A, B where A.列名 in (select distinct(条件) from 表名 where 条件='XXXXXXXXXX') 结果查询出来就有值了! ==============
想到了一个办法,可以试试。先用a,b关联查询的集合再与c表进行外连接。如下:
select * (select A.*,B.列名 TX from
A,
B where A.列名 in (select distinct(条件) from 表名 where 条件='XXXXXXXXXX')
) tmp,C where tmp.TX = C.列名(+)(任意列)