phpbar.de logo

Mailinglisten-Archive

[php] Re: mysql query problem

[php] Re: mysql query problem

Leonhard Holz php_(at)_phpcenter.de
Sat, 20 Oct 2001 14:27:05 +0200


Hallo Liste,

> $query =
> "SELECT
> linkcounter_links.id,
> linkcounter_links.url,
> linkcounter_links.title,
> MAX(linkcounter_count.calls) AS moritz
> FROM linkcounter_links LEFT JOIN linkcounter_count
> ON linkcounter_links.id = linkcounter_count.link
> GROUP BY linkcounter_links.id;";

also ich würde das so formulieren:

"select a.id, a.url, a.title, sum(b.calls) as moritz from
linkcounter_links a, linkcounter_count b
where a.id = b.link order by a.id"

Gruß,
Leo



php::bar PHP Wiki   -   Listenarchive