Is there any way to improve this statement? A is the header table while B has 0 to many records for each record in A. I'm trying to pick only the latest record in B for the associated seq in A.
Code:
select * from A left outer join B on B.seq = A.seq and B.order = (select max(order) from B where B.seq = A.seq)
Comment