• You can use ROW_NUMBER() with PARTITION clause.

    http://msdn.microsoft.com/en-us/library/ms186734.aspx