Archive for November 30th, 2009
SQL Server: Selecting records holding group-wise maximum
Continuing the series on selecting records holding group-wise maximums:
How do I select the whole records, grouped on
grouper
and holding a group-wise maximum (or minimum) on other column?
In this article, I'll consider SQL Server.
SQL Server has very rich SQL syntax and its optimizer is really powerful.
However, some tricks are still required to make the queries like this to run faster.
Let's create a sample table:
Read the rest of this entry »