Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Select field based on max(other field) ?
Message
De
22/04/2005 10:39:09
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 8 SP1
Database:
Visual FoxPro
Divers
Thread ID:
01006645
Message ID:
01007465
Vues:
14
>
>SELECT Child.date, Child.Amount, Child.OtherField,;
>       Parent.Name, Parent.Address,Child.ParentId;
>FROM mydbc.Child AChild;
>LEFT JOIN mydbc.Parent ON AChild.ParentId = Parent.Parentid ;
>WHERE Child.date IN (SELECT MAX(Child.date) FROM Child BChild WHERE BChild.ParentId == AChild.ParentId));
>GROUP BY AChild.ParentId
>
>(not tested)

Four stars if I could give them, thank you Borislav. This is the second time that reusing a tale with another alias has solved my problem, going to have to try and remember and reuse that trick.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform