zhiqingstudy

Be a young person with knowledge and content

Q: How does the MySQL database query data in a certain range, such as data with IDs between 5-10?

Method 1:查询 id>=5 和 id<=10 的数据

实例:SELECT * FROM ceshi1 WHERE `id` >= 5 AND `id` <=10;

Suitable for scene: suitable for continuous range

Method 2: Use the between... and... syntax.

Example: SELECT * FROM ` ceshi1 ` WHERE ` id ` BETWEEN 5 AND 10;

Suitable for scene: suitable for continuous range

Method 3: Use the in... syntax.

Example: SELECT * FROM ` ceshi1 ` WHERE ` id ` IN (5,6,7,8,9,10);

Suitable for scene: suitable for discontinuous range

comment
head sculpture
Code:
Related

Why you shouldn't stay at a job for more than 2 years?

3 harsh facts long-distance relationships

how to keep your girlfriend interested in a long-distance relationship




Unless otherwise specified, all content on this website is original. If the reprinted content infringes on your rights, please contact the administrator to delete it
Contact Email:2380712278@qq.com

Filing number:皖ICP备19012824号