我希望限制父(文章)给出的行数,你知道怎么做吗? 我不想限制总行数(LIMIT x),只是来自'文章'表
SELECT * FROM articles
INNER JOIN categories
ON articles.category_id = categories.id
INNER JOIN articleInfo
ON articles.id = articleInfo.article_id
INNER JOIN articleWeights
ON articles.id = articleWeights.article_id
INNER JOIN articlePictures
ON articles.id = articlePictures.article_id
WHERE articleInfo.lang = :lang
我无助,无法在任何地方找到它。
谢谢!
答案 0 :(得分:1)
由于您提及LIMIT
,我假设您正在使用MySQL
。您可以在LIMIT
:
subquery
SELECT *
FROM (SELECT * FROM articles LIMIT 10) articles
INNER JOIN categories
ON articles.category_id = categories.id
INNER JOIN articleInfo
ON articles.id = articleInfo.article_id
INNER JOIN articleWeights
ON articles.id = articleWeights.article_id
INNER JOIN articlePictures
ON articles.id = articlePictures.article_id
WHERE articleInfo.lang = :lang