Friday, December 23, 2005

GROUP BY techniques

Useful GROUP BY techniques (source: Jeff's Blog (SQLTeam hosted)) for SQL Server developers. Rather than grouping unneccesarily columns, use a derived table. i.e. (SELECT ... FROM ... WHERE ... GROUP BY ...) AggregateTableName. Plus don't group expressions, but the columns that make up the expression.


Tags: , ,

No comments: