简体   繁体   中英

mysql select a certain range using autoincrement ID

I need to select a certain range of a table, say #1000~5000 using the auto increment ID. What should the syntax be?

SELECT column1, column2 FROM table WHERE columnID BETWEEN 1000 and 5000

SELECT * FROM table WHERE id BETWEEN 1000 AND 5000

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