View Single Post

   
  #1 (permalink)  
Old 02-28-2008, 10:45 AM
Taras_96
 
Posts: n/a
Default group by without aggregates

Hi all,

I have the following query:

select * from teams group by teamid

multiple rows may have the same teamid. The above query ensures that
each row in the result set has a distinct teamid, which is the
behaviur I want, but I can't figure out *why* it works. I know that
the group by statement defines what you wish to aggregate over, but
the above query has no aggregate functions, so I'm not quite sure why
it returns distinct team ids. Does anyone know?

Thanks

Taras

Reply With Quote