Openquery and self join tables

jerrys

New Member
I have a user who is trying to form a query with self joins and is having a hard time. I can't seem to crack the code either. Syntax errors and columns not found are the errors. Can anyone point me in the righ direction here? The application is RIMS warehouse Mgt package. Here is the code.

select avail_loc.loc_check, pick_task.*
from pub.pick_task pick_task
inner join (select rdt_id, min(pick_seq) as min_pick_seq from pub.pick_task where pick_status='P'
group by rdt_id ) min_pick on pick_task.rdt_id=min_pick.rdt_id and pick_task.pick_seq=min_pick.MIN_PICK_SEQ
inner join pub.avail_loc avail_loc on pick_task.loc=avail_loc.loc
where pick_task.pick_status = 'P' order by rdt_id, pick_seq, pick_task.loc
 
Back
Top