Joining to first row in SQL should be as trivial as simply joining to an inner select
select so_nbr, sod_line last_line
from so_mstr
join sod_det on sod_det.rowid = (select top 1 sod_det.rowid
from sod_det
where sod_nbr = so_nbr
order by sod_line desc) x
where so_ord_date > curdate() - 60
Unfortunately I get: Error code -20302, SQL state HY000: [DataDirect][OpenEdge JDBC Driver][OpenEdge] TOP clause used in unsupported context. (13694)
Note, I am stuck on OE10.1C and will not be able to upgrade.