sql server - select top and bottom rows
- by Adrian Faciu
Hi,
I'm using Sql Server 2005 and i'm trying to achieve something like:
In the same select statement i want to get the first x rows and the last x rows.
SELECT TOP(5) BOTTOM(5)
Of course 'bottom' does not exist so i need other solution.
I believe there is an easy and elegant solution that i'm not getting.
Doing the select again with Group By Desc is not an option.
Thanks.