1.select * from dzkp a,xcd b where a.chengjiren_id=b.chengjiren_id
2.select kp_code from dzkp where kp_id not in (select a.kp_id from dzkp a,xcd b where a.chengjiren_id=b.chengjiren_id)
3.select xcd_code from xcd where xcd_id not in (select b.xcd_id from dzkp a,xcd b where a.chengjiren_id=b.chengjiren_id)
如何能让这三个显示在一个页面,取得的记录按1.2.3来排列出来.
2.select kp_code from dzkp where kp_id not in (select a.kp_id from dzkp a,xcd b where a.chengjiren_id=b.chengjiren_id)
3.select xcd_code from xcd where xcd_id not in (select b.xcd_id from dzkp a,xcd b where a.chengjiren_id=b.chengjiren_id)
如何能让这三个显示在一个页面,取得的记录按1.2.3来排列出来.
Union All
select kp_code from dzkp where kp_id not in (select a.kp_id from dzkp a,xcd b where a.chengjiren_id=b.chengjiren_id)
Union All
select xcd_code from xcd where xcd_id not in (select b.xcd_id from dzkp a,xcd b where a.chengjiren_id=b.chengjiren_id)
-----------------
不错
三個查詢的個數雖然相同,但第三個查詢的字段與上面兩個查詢的字段不同哦。。
1樓這樣的union all是否有問題?
三個查詢的個數雖然相同,但第三個查詢的字段與上面兩個查詢的字段不同哦。。
-------------
如果字段數目和類型一致,沒有問題。