> As you can see, that last query does not result in any error, however
> col2 should not be selectable if not in the group by clause?
>
> Is this a feature, a known bug or an unknown one? If this is a
> feature, is there a pragma to forbid such a syntax?

It's sort of a "feature" of SQLite. It's even documented on SQLite
website. And there's no way to prohibit such syntax - you have to
check your queries carefully.


Pavel

On Fri, Jun 11, 2010 at 5:30 AM, Benoit Mortgat <mort...@gmail.com> wrote:
> Hello
>
> I am running the last version on SQLite (precompiled 3.6.23.1 binary
> release for Windows as found on
> http://www.sqlite.org/sqlite-3_6_23_1.zip) command line. Here is the
> input:
>
> create temporary table foo(col1 text, col2 text);
> insert into foo values('a','b');
> insert into foo values('a','c');
> insert into foo values('b','d');
> insert into foo values('b','e');
> .mode
> select col1, col2 from foo group by col1;
>    a|c
>    b|e
>
> As you can see, that last query does not result in any error, however
> col2 should not be selectable if not in the group by clause?
>
> Is this a feature, a known bug or an unknown one? If this is a
> feature, is there a pragma to forbid such a syntax?
>
> Have a nice day
>
> --
> Benoit Mortgat
> 20, avenue Marcel Paul
> 69200 Vénissieux, France
> +33 6 17 15 41 58
> +33 4 27 11 61 23
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@sqlite.org
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to