>Below is from the help file. If I understand this change I can nolonger just list the fields I want grouped. I have to list the field grouping of all the fields.
>
>So if I have table with 5 fields I must list all 5 as in
>"Group by 3,2,1,4,5" even if all I'm concern with is with fields 3 and 2. Can anybody confirm? TIA
>
More or less. It's always been bad design to have fields in the query that neither include an aggregate function or appear in the GROUP BY clause. You couldn't count on the data in those fields--VFP took it randomly from the last record in the group.
For example, the following query produces unexpected results:
SELECT Name, State, MAX(birthdate) ;
FROM People ;
GROUP BY State
You'd think it gives you the youngest person for each state, but in fact, it gives you the birthdate of the youngest person and the name of one person at random.
In VFP 8, they've tightened up the query engine to prevent you from writing that sort of query. However, because many of us have older code that does it, there's a new SYS() function and the SET ENGINEBEHAVIOR command to let you run such queries.
My recommendation is to use SET ENGINEBEHAVIOR only with older code, and to make sure all new code is compliant with the VFP 8 behavior.
Tamar
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only