Re: Count() does not count correctly?

2002-01-07 Thread Rodney Broom
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:

Re: Count() does not count correctly?

2002-01-07 Thread Gerald Clark
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

RE: Count() does not count correctly?

2002-01-07 Thread Haapanen, Tom
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

Count() does not count correctly?

2002-01-07 Thread Jens Mildner
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