Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SQL to retrieve maximum value from a row.
Message
 
To
All
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
SQL to retrieve maximum value from a row.
Miscellaneous
Thread ID:
00305138
Message ID:
00305138
Views:
43
I have a table containing a key, date and 48 values for each record.
I need to retrieve the maximum value for each key for each month - but this value may be any of the 48 values - e.g.
Key Date f1 f2 f3 f4
A00408, 01/02/1999, 12, 15, 16, 18
A00408, 01/02/1999, 13, 18, 20, 22
I need to return the maximum value and field in the example above it would be f4 and 22. You can do this in Excel using the MAX() function and providing a range. Would my best best be to paste this data into Excel and use Max() or can it be done in 1 or a couple of SELECT statements.

Thanks,
Martin
If only everything in life was as reliable as VFP
Next
Reply
Map
View

Click here to load this message in the networking platform