Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Show maximum of 3 columns
Message
 
 
To
17/09/2001 15:43:41
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00557471
Message ID:
00557479
Views:
18
This message has been marked as a message which has helped to the initial question of the thread.
>For each record, I need to retrieve the maximum of 3 columns.
>
>Example:
>ID 1 has column C1= 2, C2=5, C3=1
>ID 2 has column C1=6, C2=3, C3=8
>
>I need maximum of C1,C2,C3:
>ID 1 gives 5
>ID 2 gives 8
>
>Can we do this using SELECT statement?
>Thank you all!
select ID, iif(c1>c2,iif(c1>c3,c1,c3),iif(c2>c3,c2,c3)) as Max_c ;
       from yourTable into cursor curMax
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform