On Thu, 23 Jan 2014 13:28:50 -0600 John McKown <[email protected]> wrote:
> > SELECT * FROM A WHERE projid = (SELECT projid FROM B WHERE ptask = > > 'a'); > > > > This only returns one record (record 1) where it should return all > > the records with ptask = 'a'. > > No, it is working properly. The reason is that the SELECT from the B > table returns two values. The WHERE clause in the outer SELECT from > the A table only tests the projid from the first value returned, not > "either" value being equal. I'm not so sure about "properly". Silently providing an arbitrary result may be expected if you know to look for it. AFAIK it's not documented and it's hard to defend logically. The correct SQL result would be a syntax error message indicating comparison of a scalar to a non-scalar. --jkl _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

