From: Jens Mildner <[EMAIL PROTECTED]>
> Every year from years.year should be returned along with the
> number of games that have been released in that year...
> Years in which no games were released are returned with a
> gamecount of 1.
This is a side effect of the JOIN syntax. Try this:
Jens Mildner wrote:
> Hello MySQL-users !
>
> Houston, I've got a problem here.
>
> I'm running the following query from a PHP-Script:
>
> SELECT years.year AS yearlist, count(years.year) AS gamecount
>
> FROM years
>
> LEFT JOIN games
>
> ON years.year = games.release_year
>
> GROUP
Jens Mildner [mailto:[EMAIL PROTECTED]]
Sent: Monday, 07 January, 2002 15:08
To: [EMAIL PROTECTED]
Subject: Count() does not count correctly?
Hello MySQL-users !
Houston, I've got a problem here.
I'm running the following query from a PHP-Script:
SELECT years.year AS yearlist, count
Hello MySQL-users !
Houston, I've got a problem here.
I'm running the following query from a PHP-Script:
SELECT years.year AS yearlist, count(years.year) AS gamecount
FROM years
LEFT JOIN games
ON years.year = games.release_year
GROUP BY years.year
ORDER BY gamecount DESC, yearlist
T