I currently have this statement:
But this isn't exactly what I want. What I really want is the fields that are associated with the most recent sequence number (RPSEQ) for each RPJOB. So the max value of RPSEQ for each RPJOB, and then all the fields that are associated with that record. Instead what I'm currently getting is the max RPSEQ, the max RPSTAT, and the max date, but these may come from different records for the same RPJOB.
Thanks in advance!
Code:
select max(rpjob) as Job, max(rpseq) as Seq, max(rpstat) as RPStatus, max(date(rpts)) as RPDate from myLib.myFile group by rpjob
Thanks in advance!
Comment