📜  多左连接mysql代码示例

📅  最后修改于: 2022-03-11 15:05:33.894000             🧑  作者: Mango

代码示例1
SELECT news.id, users.username, news.title, news.date, news.body, COUNT(comments.id)
FROM news
LEFT JOIN users
ON news.user_id = users.id
LEFT JOIN comments
ON comments.news_id = news.id
GROUP BY news.id