日期:2014-05-18 浏览次数:20683 次
方法一:
select m.货号 from table1 m where m.货号 not in (select 货号 from table2)
union all
select m.货号 from table1 m , table2 n where m.货号 = n.货号 and m.数量 <> n.数量
方法二:
select m.货号 from table1 m where not exists (select 1 from table2 n where n.货号 = m.货号)
union all
select m.货号 from table1 m , table2 n where m.货号 = n.货号 and m.数量 <> n.数量