Nieuw lid |
|
Ik heb een poging gewaagd.
SELECT blog_articles.idItem, blog_articles.articleTitle, kernel_users.userName, COUNT( kernel_replies.id ) AS ReplyCount
FROM blog_articles
JOIN kernel_replies ON kernel_replies.idItem = blog_articles.idItem
JOIN kernel_users ON kernel_users.userId = kernel_replies.authorId
WHERE kernel_replies.siteId =3
AND kernel_replies.deleted =0
GROUP BY blog_articles.idItem
ORDER BY kernel_replies.id DESC
SELECT blog_articles.idItem, blog_articles.articleTitle, kernel_users.userName, COUNT( kernel_replies.id ) AS ReplyCount FROM blog_articles JOIN kernel_replies ON kernel_replies.idItem = blog_articles.idItem JOIN kernel_users ON kernel_users.userId = kernel_replies.authorId WHERE kernel_replies.siteId =3 AND kernel_replies.deleted =0 GROUP BY blog_articles.idItem ORDER BY kernel_replies.id DESC
Enige probleem is nog dat mijn order by totaal zinloos lijkt te zijn :S |