Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想获取给定帖子的所有喜欢的列表。我遇到的问题是没有可以用来“翻页”的时间戳字段,并且有些帖子的赞数超过 5000(5000 是您一次可以获得的最多记录)
如何获得超过 5000 个赞的帖子的所有赞?
使用LIMIT和OFFSET:
LIMIT
OFFSET
SELECT user_id FROM like WHERE post_id = "POST_ID" LIMIT 5000 OFFSET [n * 5000 + 1]
Where n= 0, 1, 2, ... 根据需要,直到查询失败。
n