helloWORLD
helloWORLD

Reputation: 21

MySQL query question

Is there a way I can tell my MySQL query to start from a specific id and end at another using MySQL?

Upvotes: 1

Views: 76

Answers (2)

Murali
Murali

Reputation: 35

Using between operator you can achieve what you want.

syntax:

SELECT * FROM your_table_name WHERE id BETWEEN 'x' AND 'y'

Upvotes: 0

Haim Evgi
Haim Evgi

Reputation: 125496

use where id between x and y

http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_between

update according to the remark

one option : where id =x or id = y . second option : where id in (x,y)

Upvotes: 1

Related Questions