简体   繁体   中英

MySQL query question

有没有办法让我的MySQL查询使用MySQL从一个特定的ID开始并在另一个ID结束?

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)

Using between operator you can achieve what you want.

syntax:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM