Random musings - Group by

View previous topic View next topic Go down

Random musings - Group by

Post  Edwin Kurian on Wed Feb 18, 2009 7: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

View user profile http://www.valordevelopment.com

Back to top Go down

Re: Random musings - Group by

Post  BoxesAndLines on Wed Feb 18, 2009 10:27 am

Because the DBMS requires it.

BoxesAndLines

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

View user profile

Back to top Go down

Re: Random musings - Group by

Post  Edwin Kurian on Wed Feb 18, 2009 2: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

View user profile http://www.valordevelopment.com

Back to top Go down

Over partition

Post  slaborda on Wed Feb 18, 2009 2: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: 34
Location: Barcelona, Via lactea, earth, Europe, Spain, Barcelona

View user profile

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

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