Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Catch 22 on group by
Message
From
19/05/2001 11:39:18
 
 
To
18/05/2001 08:29:42
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Miscellaneous
Thread ID:
00508311
Message ID:
00509089
Views:
19
>> ... but in my opinion, SQL server has a big flaw in requiring every field in the group by - because in JOINED selects, you do NOT have the case you are indicating, but something more like:

Let's take a simplier example:
City        State
----        -----
Cincinnati  Ohio
Cleveland   Ohio
Columbus    Ohio
Dayton      Ohio
New York    New York
Albany      New York
SELECT City, State
FROM the_table
GROUP BY State

What values would you expect for City? The first? The last? BTW, which is the first or the last?

By requiring every column in the column list to be in either the GROUP BY or an Aggregate function, SQL Server is capable of determining the value w/o "guessing".

-Mike
Michael Levy
MCSD, MCDBA
ma_levy@hotmail.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform