On Sep 5, 2012, at 11:00 PM, Igor Tandetnik <itandet...@mvps.org> wrote:
>> And such statement should raise an exception if the scalar sub-query returns >> multiple rows, no? > > Definitely not in SQLite. I don't believe it would do that in other DBMS > either, but won't bet on it. SQLite would take the value from the first row, > or NULL if there are no rows. Oracle, for example, will make sure that a scalar query stays, hmmm, scalar. If not, it will raise an error [1]. Ditto for Postgres [2]. After all, what's the "first row" of a scalar sub-query without an explicit ordering? 'Random' is usually how it's called. In my opinion, this is yet again one of these rather, hmmm, "weird" behaviors of SQLite. A bit along the line of that "unique" 'group by' behavior discussed in another thread somewhere else. One person feature is another person bug. [1] http://docs.oracle.com/cd/B28359_01/server.111/b28286/expressions013.htm [2] http://www.postgresql.org/docs/9.1/static/sql-expressions.html _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users