Get a range of tests from Quality Center in SQL Server

SQL Server doesn’t have a LIMIT function like MySQL, but a little digging with Google turned up a query that looks something like this:


SELECT test.*
FROM (
SELECT test.*, ROW_NUMBER() OVER (ORDER BY TS_TEST_ID) AS row FROM test
) test
WHERE test.row BETWEEN 10 and 15

based on this post on Stack Overflow:
http://stackoverflow.com/questions/5151013/limit-style-functionality-in-ms-sql-server-2005

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s