Re: [sqlite] ORDER BY disregarded for GROUP BY

2011-11-01 Thread Jay A. Kreibich
On Fri, Oct 28, 2011 at 06:42:06PM +0200, Tobias Sj??sten scratched on the wall: > I have a table: > > CREATE TABLE t > ( > i INT, > g VARCHAR(1), > v INT > ); > But when I group it by 'g' it completely disregards the ordering: > > > SELECT g,v FROM t GROUP BY g ORDER BY v ASC; > a|3 > b|3 > >

Re: [sqlite] ORDER BY disregarded for GROUP BY

2011-10-28 Thread Sean Pieper
@sqlite.org Subject: [sqlite] ORDER BY disregarded for GROUP BY I have a table: CREATE TABLE t ( i INT, g VARCHAR(1), v INT ); And the data: INSERT INTO t (i,g,v) VALUES (1,'a',2); INSERT INTO t (i,g,v) VALUES (1,'a',1); INSERT INTO t (i,g,v) VALUES (1,'a',3); INSERT INTO t (i,g,v) VALUES (1,'b',2

Re: [sqlite] ORDER BY disregarded for GROUP BY

2011-10-28 Thread Igor Tandetnik
On 10/28/2011 12:42 PM, Tobias Sjösten wrote: But when I group it by 'g' it completely disregards the ordering: SELECT g,v FROM t GROUP BY g ORDER BY v ASC; a|3 b|3 What seems to be the problem? The resultset is ordered by the second column, isn't it? What did you expect to happen

[sqlite] ORDER BY disregarded for GROUP BY

2011-10-28 Thread Tobias Sjösten
I have a table: CREATE TABLE t ( i INT, g VARCHAR(1), v INT ); And the data: INSERT INTO t (i,g,v) VALUES (1,'a',2); INSERT INTO t (i,g,v) VALUES (1,'a',1); INSERT INTO t (i,g,v) VALUES (1,'a',3); INSERT INTO t (i,g,v) VALUES (1,'b',2); INSERT INTO t (i,g,v) VALUES (1,'b',1); INSERT INTO t