oracle 找出两表之间重复数据

select * from ( select tb1.rollid from (select r.rollid as rollid from zh1_rool r where r.date_p >=to_date('2009-11-26 23:59:59','yyyy-mm-dd hh24:mi:ss') ) tb1   where tb1.rowid !=   ( select max(tb2.rown) from (select t.rowid as rown,t.lot_number as rollid from inv.mtl_onhand_quantities_detail t left join mtl_system_items_b mi on t.inventory_item_id = mi.inventory_item_id where mi.segment1 like '101%' and mi.organization_id = 102) tb2 where tb2.rollid=tb1.rollid   ) )tb3

你可能感兴趣的:(oracle,10g)