Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
V6s5 - SQL for Parent and only the Latest Child rec
Message
 
À
29/03/2004 02:42:50
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00888750
Message ID:
00890362
Vues:
19
Hi Cetin

>You don't need to group by but be careful this is not the same with the one we suggested.
>
>
SELECT tNonCummu.*, sNonCummu.*
>    FROM tNonCummu
>       JOIN sNonCummu ON tNonCummu.iID = sNonCummu.iPID
>    WHERE sNonCummu.dDueDt =
>       (SELECT MAX(sNC.dDueDt)
>          FROM sNonCummu sNC where sNonCummu.iPID = sNC.iPID )
Cetin

The original returned only one record between all parent so I added the GROUP BY, thus getting one for each parent, did I mess up somewhere? I'll try them both again.
Regards
Bhavbhuti
___________________________________________
Softwares for Indian Businesses at:
http://venussoftop.tripod.com
___________________________________________
venussoftop@gmail.com
___________________________________________
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform