Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Selecting the Max
Message
De
29/06/2006 09:18:09
Jon Neale
Bond International Software
Wootton Bassett, Royaume Uni
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01132678
Message ID:
01132695
Vues:
16
True, maybe I should have read all of the query before posting an answer!!!

>You can, but what if you have this type of data:
>
>ColumnCode1  ColumnCode2  ColumnCode3   CodeCount
>Code1          Code2         code3         3
>Code1          Code2         Code4         2
>Code3          Code1         Code4         12
>Code7          Code9         Code1         21
>
>
>
>
>>Can you use SELECT TOP 1 and then order it by codecount desc?
>>
>>>I feel like I've done this before but for the life of me I can't remember how I did it:
>>>
>>>Using just SQL Select how can I get the items with the Max count.
>>>
>>>Source table
>>>
>>>ColumnCode1  ColumnCode2  ColumnCode3   CodeCount
>>>Code1          Code2         code3         3
>>>Code1          Code2         Code4         2
>>>
>>>
>>>What I'm trying to get to is for each identical ColumnCode1, ColumnCode2 I want to see only the ColumnCode3 with the most CodeCount.
>>>
>>>Something like this:
>>>
>>>ColumnCode1  ColumnCode2  ColumnCode3
>>>Code1          Code2         code3
>>>
>>>
>>>Any ideas?
>>>
>>>Richard
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform