In the end I had to nest a query within a nested query to get the required results. Here is the core of the query - feel free to use it in your own endeavors:
Select A.MANUFACTUREORDER_I,WR.RTSEQDES_I
From WR010130 WR
inner join
(Select MANUFACTUREORDER_I,MIN(RTSEQNUM_I) Sequence
from WR010130 where
DONECB_I !=1 Group
by MANUFACTUREORDER_I)
A
on WR.MANUFACTUREORDER_I
= A.MANUFACTUREORDER_I
No comments:
Post a Comment