我有一个sql语句
select * from users u left join files f on u.id = f.user_id where f.mime_type = 'jpg' order by u.join_date desc limit 10 offset 10
这有效地选择了第二个10元素页面.
解决方法
您需要首先限制外部表上的选择,然后将依赖表连接到结果.
select * from (select * from users limit 10 offset 10) as u left join files f on u.id = f.user_id