>Von: "Richard Hipp" <d...@sqlite.org>
>An: "General Discussion of SQLite Database" <sqlite-users@sqlite.org>
>Betreff: Re: [sqlite] BUG with unnecessary brackets in queries with IN ( 
>SELECT .. )
>On Sun, Jun 8, 2014 at 7:52 PM, Martin Hristov <tra...@gmail.com> wrote:
>
>> Simple example :
>>
>> Working (correct result)
>> select id from tbl where id in (select id from tbl)
>>
>> NOT working (incorrect result) :
>> select id from tbl where id in ( ( select id from tbl) )
>>
>
>In the first query, SQLite looks for values of "id" that are in the
>subquery.
>
>In the second query, the subquery is evaluated as an expression. That
>means that only the first row of the result set is used. And the
>right-hand side of the IN clause is a list of expressions instead of a
>subquery.
>
>So the two queries mean different things.
>
>
>--
>D. Richard Hipp
>d...@sqlite.org
>
 
Just a bit surprising to find that postgres delivers the same answer to both 
queries, after having seen your presentation on PGCon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to