Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
SQL syntax for the following
Message
De
31/07/2007 02:10:39
 
 
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:
01244768
Vues:
16
Hi Naomi,

Thanks for your reply.

I noticed you have 2 selects after the INNER JOIN, so I removed 1 and get a T1 Alias not found error.

Maybe the inner join not quite right.

Regards
Doug Johnston



>>Hi,
>>
>>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.
>>
>>Regards
>>Doug Johnston
>
>Doug,
>
>Please try, not tested:
>
>select T1.* from Table T1 inner join ;
>(select SELECT TOP 20 PERCENT PK ;
>FROM Table ORDER BY iScore where cGroup = T1.cGroup) S1 on T1.PK = S1.PK
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform