Can you apply LIMIT on MySQL before LEFT JOIN another?

為{幸葍}努か 提交于 2019-11-30 18:01:37

You can do it by joining on a subquery instead of an actual table. Something like this should work:

SELECT * FROM
    (SELECT * FROM table_1 LIMIT 5) as subq
    LEFT JOIN table_2 ON subq.id = table_2.id WHERE 1
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!