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.  The results are unlikely to be useful, however.

  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

-- 
Jay A. Kreibich < J A Y  @  K R E I B I.C H >

"Our opponent is an alien starship packed with atomic bombs.  We have
 a protractor."   "I'll go home and see if I can scrounge up a ruler
 and a piece of string."  --from Anathem by Neal Stephenson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to