Kimball Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Random musings - Group by

Go down

Random musings - Group by Empty Random musings - Group by

Post  Edwin Kurian Wed Feb 18, 2009 11:22 am

Is the Group by clause in a Select statement redundant? Why is it even needed?
Hoping to get your thoughts.

Edwin

Edwin Kurian

Posts : 13
Join date : 2009-02-03
Location : Milwaukee

http://www.valordevelopment.com

Back to top Go down

Random musings - Group by Empty Re: Random musings - Group by

Post  BoxesAndLines Wed Feb 18, 2009 2:27 pm

Because the DBMS requires it.
BoxesAndLines
BoxesAndLines

Posts : 1212
Join date : 2009-02-03
Location : USA

Back to top Go down

Random musings - Group by Empty Re: Random musings - Group by

Post  Edwin Kurian Wed Feb 18, 2009 6:03 pm

That is what I am trying to understand...Why does the DBMS need it.
Logically if any columns are aggrergated, shouldn't the SQL group by the other columns?
Is there a case where some columns are aggregated, and some of the other columns are not part of the group by?

Edwin Kurian

Posts : 13
Join date : 2009-02-03
Location : Milwaukee

http://www.valordevelopment.com

Back to top Go down

Random musings - Group by Empty Over partition

Post  slaborda Wed Feb 18, 2009 6:46 pm

It depends on database engine.

Please search in google info about "over partition" clause.
With this you can combine aggregated data with detail data.

Sergi

slaborda

Posts : 3
Join date : 2009-02-18
Age : 43
Location : Barcelona, Via lactea, earth, Europe, Spain, Barcelona

Back to top Go down

Random musings - Group by Empty Re: Random musings - Group by

Post  Sponsored content


Sponsored content


Back to top Go down

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum