On Wed, 6 May 2009 00:40:22 -0500, "Jay A. Kreibich" <j...@kreibi.ch> wrote:
>On Tue, May 05, 2009 at 11:46:38PM +0200, Kees Nuyt scratched on the wall: >> On Tue, 5 May 2009 16:55:42 -0400, Pavel Ivanov >> <paiva...@gmail.com> wrote: >> >> >Is it just me or somebody else is >> >seeing too that the sql statement >> > "select blobid, fbid from sig group by peerid" >> >is invalid and shouldn't be >> >executed or prepared at all? >> >> You are right, it doesn't make sense. > > It doesn't make a lot of sense, but it is still valid. > >> @Joannek: When using group by, your select columns can only >> use aggregate functions and the columns you group by. > > "should only", not "can only." SQLite will happily execute that > statement. I stand corrected. >The results are unlikely to be useful, however. Indeed. We had a discussion before about generating an error in these cases. I wouldn't mind, but I'm sure it would break a lot of code. > When SQLite is asked to output a column that is not aggregated or > grouped, the returned value for that column is simply the value > of the last found row in the group. I suspect this is the same for > the grouped columns as well, they just happen to always be the same. > > -j -- ( Kees Nuyt ) c[_] _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users