Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Sql example?
Message
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Title:
Miscellaneous
Thread ID:
00402536
Message ID:
00402807
Views:
8
>>1.- Select city,date,Max(temp) from yourtable order by city group by city,date
>>Juan C.
>

>This select would return date from last physical record for each city not date corresponded to Max(temp).

No. This SQL statement would return the maximum temp recorded for each city for each day. If you only had 1 recorded temp per day, it would return all records in the table.

Because extraneous inforamtion is needed that shouldn't be included in the GROUP BY clause (Date), you have to go with 2 SQL statements: one to store the city and maxiumum temp in a cursor and then one to use that result to join against to retrieve the other information as Trey suggested.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform