Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Group by clause in vfp8
Message
 
To
18/04/2003 14:01:13
Mike Yearwood
Toronto, Ontario, Canada
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00774269
Message ID:
00779310
Views:
31
>Hi George

Mike,

>>Assuming that you've done that, what I'll say is that in all cases it is neither necessary nor advantageous to do anything other than use SET ENGINEBEHAVIOR.
>
>I can understand there is a time when SET ENGINEBEHAVIOR is the easiest answer, but I don't think I'll ever agree that it's ever the correct answer ;).

Like I said, part of the "trick" here is knowing when to break the rules and when not to. In the case I posted to Jim Booth, it may not be the correct answer, but it's certainly, IMO, the best, since it's the most flexible and easiest to maintain.

>>
>>There's a time to adhere to the standards, and there's a time not to. The trick is knowing (through analysis of the requirements) when and where.
>>
>
>Funny, when it comes to spacing in code, you don't seem to agree with that! ;)

Moi???? I'm positively AR when it comes to spacing. Spaces between operators, after commas in parameter lists, minimum 2 space indentation. etc., etc. In fact, since I'm in charge of standards at work, one of the first questions that I asked the members of our group was, "What's the purpose of indentation? What does it demonstrate?"

Sorry, Mike, I don't get what you're referring to.

>>And Walter, adding unnecessary functions, such as MIN(), to an SQL statement unquestionably adds additional processing overhead. There's no question about it.
>
>Absolutely! But I agree with Walter that expecting to get the last record from GROUP BY is uncomfortable.

Yes, but if it's not relevant, what's the problem.

>So, can we not agree that the best answer is to write the code so it's clear what we'll get? SET ENGINEBEHAVIOR TO 7.0 only means results will be what they were before even though the results may be wrong. Further can we not make a recommendation that SET ENGINEBEHAVIOR should be a last resort? As such wouldn't the recommended approach be to do these queries as VFP 8 compatible?

I'd say that in future design, most definetly. The results of the fields involved in the functions are, from my experience, unquestionably correct. They've been tested and proven to be so, and, not once in at least the past 10 years has anyone been able to prove otherwise (and believe me, it's been tried). As I said earlier, the values of the fields not involved in the group by clause and not using an aggregate function are irrelevant.
George

Ubi caritas et amor, deus ibi est
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform