Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GROUP BY to extract the most oldest record
Message
 
 
To
05/01/2003 11:43:18
Cindy Winegarden
Duke University Medical Center
Durham, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00738069
Message ID:
00738150
Views:
20
>>It'll give you MIN(Numero) for each group but the rest of the fields in the record, that are not in group by clause, will come from the last physical record in the group which may or may not be the record with MIN(Numero).
>
>Don't forget that VFP8 will not allow queries like this. Everything that is not an aggregate field (SUM(), TOP(), etc.) that is in the SELECT clause must be included in the GROUP BY clause.

I would say "VFP8 will not allow queries like this by default" because it can be changed by using new SET ENGINEBEHAVIOR command or SYS(3099) function. However I would recomend to stick with new VFP8 database engine behavior because it's compatible with other backends like MS SQL Server, Oracle e.t.c. and queries will always produce correct result regardless of physical order of data in the source tables.
--sb--
Previous
Reply
Map
View

Click here to load this message in the networking platform