Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
GROUP BY 1 no longer works
Message
From
18/02/2003 21:43:03
 
 
To
18/02/2003 20:34:30
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00750415
Message ID:
00754784
Views:
37
I think this is probably what Garrett meant when he said that there is no correct record.

Breaking the select down, it's easy to see that Max(field1) has a real and meaningful result, but because the rest of the satement - ie - grouping that max, and field2 based on field3, is meaningless, so is the overall result.

I have to agree that making ANSI compatibility the default is sensible.

When I first heard about this, I was a bit put out like Jim is. But when I started to try to come up with a real and valuable need for the VFP7 (and previous) 'group by' system, I began to realize that it is probably a non-issue (for me).

Alan

>Hi Jim
>
>You certainly have the right to opine ;) You do understand that if you do this...
>
>select max(field1),field2 from table group by field3
>
>field1 field2 field3
> 3 A 1
> 2 B 1
> 1 C 1
>
>That the results of the query will be wrong?
>
> 3 C
>
>I'll bet most people would expect that field2 in the result would be A.
>
>>Hi Mike,
>>
>>I expressed that I felt that a different implementation would have been better IN MY OPINION.
>>Sergey, it seems, takes issue with my opinion. So when challenged, I reply. I still feel strongly that fixing the bugs and addressing ANSI compatibility were two separate issues.
>>
>>I long ago in the thread acknowledged that we get what we get and though what we got is not what I'd like, that's tough (for me).
>>But maybe this discussion will give the VFP Team pause on the next such revision decision.
>>
>>
>>>Jim
>>>
>>>Why argue about this? Was it better to be stuck with a design that could give incorrect results since Foxpro 2.x? Just because something worked the way it worked for a really long time doesn't make it right.
>>>
>>>They did give a way to maintain compatability with a backward design.
>>>
>>>>Sergey,
>>>>
>>>>>Jim,
>>>>>
>>>>>You still missing the point. They fixed bugs in SQL Engine, nothing more. The ANSI compability was a result or the way of bug fixes not an addition to the bug fixes. As Gene mentioned in Re: GROUP BY 1 no longer works Message #754560, the discussion was about what make a default, VFP7 or VFP8 SQL Engine behavior.
>>>>
>>>>So you are saying that the removal of memo allowability in DISTINCT select queries was a requirement to FIX the known bug?
>>>>And you are saying that the need to now include ALL SELECTed fields in GROUP BY was a requirement to FIX the known bug?
>>>>I don't think that either is the case, personally, but it is clear to me that at least the GROUP BY **can** be attributable to ANSI SQL compatability. I believe the both could have been fixed within the existing syntax - it's a simple matter of programming.
>>>>
>>>>I agree that there were bugs and that they have fixed them. I don't feel that it was necessary to adopt ANSI IN ORDER TO FIX THEM.
>>>>Now I don't object that ANSI compatibility was implemented TOO, because I think that is a good thing for the future.
>>>>BUT it remains that I do not feel that the implementation we got was the optimal one. And it remains that we get what we get and have to live with it.
>>>>SNIP
Previous
Reply
Map
View

Click here to load this message in the networking platform