Re: [PHP] [PHP-DEV] SQLite - Unwanted values using group-by

2012-07-11 Thread Matijn Woudt
On Wed, Jul 11, 2012 at 1:45 AM, Simon Schick wrote: > On Sun, Jul 8, 2012 at 12:33 AM, Matijn Woudt wrote: >> >> Both of the results are valid outcomes. I think you don't understand >> the GROUP BY clause well enough. The parameters in the SELECT clause, >> should be either >> 1) an aggregate fu

Re: [PHP] [PHP-DEV] SQLite - Unwanted values using group-by

2012-07-10 Thread Simon Schick
On Sun, Jul 8, 2012 at 12:33 AM, Matijn Woudt wrote: > > Both of the results are valid outcomes. I think you don't understand > the GROUP BY clause well enough. The parameters in the SELECT clause, > should be either > 1) an aggregate function (like the max function you're using) > 2) one of the p

Re: [PHP] [PHP-DEV] SQLite - Unwanted values using group-by

2012-07-07 Thread Matijn Woudt
On Sun, Jul 8, 2012 at 12:07 AM, Simon Schick wrote: > Hi, All > > May you have an idea ... > > Here's the full code-example: > http://viper-7.com/M5mldG > > I have the following SQL command: > > SELECT max(r.month+r.year*100), r.year, r.month > FROM base b LEFT JOIN remote r ON b.id = r.remote_id

[PHP] [PHP-DEV] SQLite - Unwanted values using group-by

2012-07-07 Thread Simon Schick
Hi, All May you have an idea ... Here's the full code-example: http://viper-7.com/M5mldG I have the following SQL command: SELECT max(r.month+r.year*100), r.year, r.month FROM base b LEFT JOIN remote r ON b.id = r.remote_id GROUP BY r.remote_id Now I expect that the first column in the results