Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to get a Top n dataset grouped.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00680116
Message ID:
00681558
Vues:
24
< snip >>
>Hi
>I'm afraid it will become too complcated and slow-running query but you caould try somethink like this:
>
 SELECT t.LotNumber, t.Container, t.Lot_Pieces, t.Lot_Balance FROM MyTable t
>     WHERE t.LotNumber IN (SELECT top 3 sq.LotNumber, sq.Container, sq.Lot_Balance
>                          FROM MyTable sq
>                          WHERE sq.Container = t.Container )
>
First, in VFP SELECT TOP n requires ORDER BY clause. Second, such subquery would generate an error.
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform