Hi Cetin
>In pseudocode it's like :
>
>Select distinct values
>while selecting
>select the record with the latest date and populate related fields from that record
>
>>> WHERE sNonCummu.dDueDt =
>>> (SELECT MAX(sNC.dDueDt)
>>> FROM sNonCummu sNC where sNonCummu.iPID = sNC.iPID )
>
>Tells to find latest date for 'current of' iPID.
>= works as subquery returns a single value.
Yes, but I wanted one latest for every parent, thus so. W/o group by it doesn't work it returns only one child which is the latest of the whole lot of children.