Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Max(max of 3 fields) + corresponding field
Message
De
22/10/2001 15:52:32
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
22/10/2001 15:29:26
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00571821
Message ID:
00571831
Vues:
22
>t1,t2,t3,goal1,goal2,goal3
>10,4,33,5,6,7
>55,77,8,2,3,4
>21,14,1,9,10,11
>
>1st record: maximum=33
>2nd record: maximum=77
>3rd record: maximum=21
>I need the maximum of these 3 records (maximum of 33,77 & 21) = 77
>(maximum of t1, t2 or t3 of all the records),
>PLUS the corresponding goal. For this example, it would be goal2=2.
>(t1 corresponds to goal1, t2 corresponds to goal2, etc.)
>
>SELECT MAX(IIF(t1>t2,IIF(t1>t3,t1,t3),IIF(t2>t3,t2,t3))) as xRet from table1
>This gives me the max. of t1,t2, & t3 of all the records (thanks for all your help to come up with this one),
>but how do I get the corresponding goal from the corresponding record??
>
>THANK YOU ALL!
Inge,
Visit www.FoxyClasses.com tips page. You'll find a sample SQL there.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform