Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax for the following
Message
De
31/07/2007 02:12:51
 
 
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 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01244721
Message ID:
01244769
Vues:
13
Hi Sergey,

I tried your solution, but get "Queries of this sort are not supported" error.

Regards
Doug Johnston



>Hi Doug,
>
>Assuming that idnum is PK for mytable
>
>SELECT * FROM mytable t1
>  WHERE idnum IN (SELECT TOP 20 PERCENT idnum FROM mytable WHERE cgroup = t1.cgroup ORDER BY iscore)
>ORDER BY cgroup, iscore
>
>>
>>I have a VFP table with the following structure...
>>
>>idnum
>>keyword
>>cgroup
>>iscore
>>
>>...I have one SQL statement that gets the top 20 percent (iscore) of all records (100 records returns 20), and this works fine...
>>
>>SELECT TOP 20 PERCENT,* FROM Table ORDER BY iscore
>>
>>I am now trying to get the top 20 percent (iscore) of each group (cgroup) and am struggling for the correct SQL syntax.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform