Unlike some other RDBMS, SQLite does allow for bare columns in SELECT
querys with GROUP BY
, i.e. not all selected columns need to be part of the group by or aggregate functions otherwise. In this case, the first value in the result set will be selected for the grouped output row, regardless of whether this value is constant across all entries in the result set.
Something similar seems to happen in an UPDATE
query with SELECT
where the SELECT
returns multiple rows, where only one row can be updated. In this case the first result from the SELECT
is used for updating the target row.
I'm wondering if it's possible to force SQLite to be more strict in such cases and throw an error.
For illustration, consider this fiddle. Which will update both B
properties with the first result from the SELECT
. What I would like instead is that an error is generated.