DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Simulate A (mysql)LIMIT On "MS SQLserver"

09.05.2007
| 2467 views |
  • submit to reddit
        return lines from 7995 to 8000 (5 lines)

select * from (
select top 5 * from 
(select top 8000 * from TABLE order by 1 asc) as tbl1 order by 1 desc 
) as tbl2 order by 1 asc