asdasdasdasdqwe
asdasdasdasdqwe

Reputation: 331

how to get specific set of records in sql server

Say I have 50 records in my table,(unique id is auto increment from 1 to 50) how do I retrieve records 10 to 30 using a sql query

Upvotes: 1

Views: 474

Answers (2)

Stuart Ainsworth
Stuart Ainsworth

Reputation: 12940

SELECT columnlist
FROM yourTable
WHERE IDColumn BETWEEN 10 AND 30

Upvotes: 1

user596075
user596075

Reputation:

select *
from yourTable
where yourIdColumn between 10 and 30

Replace yourTable with your table's name, and yourIdColumn with the name of your unique id field.

Upvotes: 1

Related Questions