第1个回答 2006-04-22
如果b表的记录在a表中不存在,就取出该记录
select * from tb where col_a not in(select ta.col_a from ta,tb where ta.col_a=tb.col_a and ta.col_b=tb.col_b)
也可以用exists语句
select * from tb c where not exists(select * from ta,tb where ta.ca=tb.ca and ta.cb=tb.cb and c.ca=ta.ca)
第2个回答 2006-04-22
(select a.* from a,b where a.col_a<>b.col_a or a.col_b<>b.col_b) union (select b.* from a,b where a.col_a<>b.col_a or a.col_b<>b.col_b)
第3个回答 2006-04-22
我想了半天,想不出用sql语句该如何处理
我的意思是分别读出数据 到数组A,B中再做相应处理
--------
请教楼下的高见..