David Raymond wrote:
> My brain started yelling that that needed a "limit 1" on the subquery so that 
> it would only return 1 row.
>
> How is that handled by other databases?

SQL-92 says:
|   6.11  <value expression>
|
|   General Rules
|
|   2) If a <value expression primary> is a <scalar subquery> and the
|      result of the <subquery> is empty, then the result of the <value
|      expression primary> is the null value.
|
|   7.11  <scalar subquery>, <row subquery>, and <table subquery>
|
|   General Rules
|
|   1) If the cardinality of a <scalar subquery> or a <row subquery> is
|      greater than 1, then an exception condition is raised: cardinal-
|      ity violation.

But SQL-92 has no easy way to limit the number of rows, and not even
trying to retrieve a second row might be easier to implement, so many
databases chose not to check for this error.


Regards,
Clemens
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to