SQL Server: Difference between PARTITION BY and GROUP BY

Posted by Mike Mooney on Stack Overflow See other posts from Stack Overflow or by Mike Mooney
Published on 2010-03-08T20:40:45Z Indexed on 2010/03/08 20:51 UTC
Read the original article Hit count: 583

I've been using GROUP BY for all types of aggregate queries over the years. Recently, I've been reverse-engineering some code that uses PARTITION BY to perform aggregations. In reading through all the documentation I can find about PARTITION BY, it sounds a lot like GROUP BY, maybe with a little extra functionality added in? Are they two versions of the same general functionality, or are they something different entirely?

© Stack Overflow or respective owner

Related posts about sql-server

Related posts about tsql