or maybe something like:WITH cteAS( select pw.schbat, adrmst.adrnam, adrmst.adrln1, adrmst.adrcty, adrmst.adrstc, adrmst.adrpsz, invlod.lodnum, shipment.host_ext_id, shipment_line.ordnum, car_move.car_move_id ,ROW_NUMBER() OVER (PARTITION BY invlod.lodnum ORDER BY <whatever columns you want>) AS rn from aremst join locmst on (aremst.arecod = locmst.arecod) and (aremst.wh_id = locmst.wh_id) join invlod on (locmst.stoloc = invlod.stoloc) and (locmst.wh_id = invlod.wh_id) join invsub on (invlod.lodnum = invsub.lodnum) join invdtl on (invsub.subnum = invdtl.subnum) join shipment_line on (shipment_line.ship_line_id = invdtl.ship_line_id) join shipment on (shipment_line.ship_id = shipment.ship_id) join adrmst on ('A0000'+shipment.host_ext_id = adrmst.host_ext_id) left outer join stop on (stop.stop_id= shipment.stop_id) left outer join car_move on (stop.car_move_id = car_move.car_move_id) left join pckwrk pw on invdtl.wrkref = pw.wrkref where car_move.car_move_id = 'abcxyz')SELECT *FROM cteWHERE rn = 1;