phpbar.de logo

Mailinglisten-Archive

COUNT() und mehrere Tabellen

COUNT() und mehrere Tabellen

Ralf Eggert mysql_(at)_lists.phpcenter.de
Mon, 23 Jul 2001 10:05:43 +0100


Hallo,

>SELECT news.id, COUNT(emitted) AS emitted FROM news, emitted_news
>left joine news.id = emitted_news.id GROUP BY news.id ORDER BY updated
>DESC

richtig sollte es so heissen:

SELECT news.id, COUNT(emitted) AS emitted 
FROM news
LEFT JOIN emitted_news
ON news.id = emitted_news.id
GROUP BY news.id
ORDER BY updated

Gruss,

        Ralf

-- 
__________________________________________
 In-Greece.de - die Griechenlandcommunity
_______ http://www.in-greece.de/ _________

---
!!NEU!!
Fragen und Antworten zu MySQL und dieser Liste unter
-->>  http://www.4t2.com/mysql 



php::bar PHP Wiki   -   Listenarchive