select a.id,a.docno,a.docdt,; b.id as childid, b.duedt, b.amount ; from SAMPLE_parent a left join sample_child b on a.id = b.parentid ; where b.id = ; (select MAX(id) from sample_child c where c.parentid = b.parentid)The results are the same as from backend.
>select a.id,a.docno,a.docdt,; > b.id as childid, b.duedt, b.amount ; > from parent a left join child b on a.id = b.parentid ; > where b.DueDt = ; > (select MAX(DueDt) from child c where c.parentid = b.parentid) >>PS: Used DueDt instead of id just thinking they might be entered out of order.
>>select a.id,a.docno,a.docdt,b.id as childid, b.duedt, b.amount from parent a left join child b >>on a.id = b.parentid where b.id = (select MAX(id) from sample_child where parentid = a.id) >>>>If is VFP, I think that this will be available in VFP9 ("Queries of this type not supported" error message)