Mailinglisten-Archive |
> SELECT news.*, > news_kategorien.name, > news_kategorien.farbe AS katfarbe, > user.userid, > user.nickname, > user.farbe, > COUNT(meinung_artikel.forumid) AS newsposts, > bilder.thumbURL, > news_bilder.thumbURL, > COUNT(vote.vnote) AS Anzahlvonvnote, > SUM(vote.vnote) AS Summevonvnote > FROM news > LEFT JOIN news_kategorien > ON news.newskatID = news_kategorien.id > LEFT JOIN user > ON news.autorID = user.userid > LEFT JOIN meinung_artikel > ON news.id = meinung_artikel.forumid > LEFT JOIN bilder > ON news.thumbID = bilder.id > LEFT JOIN news_bilder > ON news.thumbID = news_bilder.id > LEFT JOIN vote > ON news.id = vote.newsid > GROUP BY news.id > HAVING news.online = 1 > AND news.fertig = 1 > AND news.gesperrt = 0 > ORDER BY news.online_date DESC fäält mir noch was ein, statt dem having ein wehre könnte das query eventuell beschleunigen, also: SELECT news.*, news_kategorien.name, news_kategorien.farbe AS katfarbe, user.userid, user.nickname, user.farbe, COUNT(meinung_artikel.forumid) AS newsposts, bilder.thumbURL, news_bilder.thumbURL, COUNT(vote.vnote) AS Anzahlvonvnote, SUM(vote.vnote) AS Summevonvnote FROM news LEFT JOIN news_kategorien ON news.newskatID = news_kategorien.id LEFT JOIN user ON news.autorID = user.userid LEFT JOIN meinung_artikel ON news.id = meinung_artikel.forumid LEFT JOIN bilder ON news.thumbID = bilder.id LEFT JOIN news_bilder ON news.thumbID = news_bilder.id LEFT JOIN vote ON news.id = vote.newsid WHERE news.online = 1 AND news.fertig = 1 AND news.gesperrt = 0 GROUP BY news.id ORDER BY news.online_date DESC -- Sebastian Mendel www.sebastianmendel.de www.tekkno4u.de www.nofetish.com
php::bar PHP Wiki - Listenarchive