SELECT a.business_unit , a.receiver_id , a.recv_ln_nbr , a.recv_ship_seq_nbr , a.distrib_line_num , a.business_unit_in FROM ps_recv_ln_distrib a WHERE a.business_unit_in <> ' ' UNION SELECT b.business_unit , b.receiver_id , b.recv_ln_nbr , b.recv_ship_seq_nbr , b.distrib_line_num , b.business_unit_in FROM ps_recv_ln_distrib b , PS_PO_SF_OP_LIST c , PS_RECV_LN_SHIP d WHERE d.business_unit = b.business_unit AND d.receiver_id = b.receiver_id AND d.recv_ln_nbr = b.recv_ln_nbr AND d.recv_ship_seq_nbr = b.recv_ship_seq_nbr AND d.business_unit_in = c.business_unit AND d.production_id = c.production_id AND d.op_sequence = c.op_sequence AND c.subcontracted = 'Y' AND b.business_unit_in = ' '
|