简体   繁体   English

SQL:从特定ID中选择20个条目

[英]SQL : Select 20 entries from a specific id

I would like to select 20 entries in my "USERS" table from a specific id numbers. 我想从特定的ID号中选择“ USERS”表中的20个条目。

=========================
====== USERS ============
=========================
- id
- name
- surname
- mail
- town
=========================

For example, i have 100 entries in USERS table, the id parameter passed in my script is 34. I would like to retrieve the 20 next entries from entry which is 34. 例如,我在USERS表中有100个条目,在脚本中传递的id参数是34。我想从34个条目中检索20个下一个条目。

SELECT *
FROM Users
WHERE id >= 34
ORDER BY id ASC
LIMIT 20

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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