2 ms·
Postgres has this too afaik? Yeah![1] with some caveats, that also apply to the sqlite implementation if im not mistaken: When a FROM clause is present, what
by isoprophlex 6y ago
Postgres has this too afaik?
Yeah![1] with some caveats, that also apply to the sqlite implementation if im not mistaken:
When a FROM clause is present, what essentially happens is that the target table is joined to the tables mentioned in the from_item list, and each output row of the join represents an update operation for the target table. When using FROM you should ensure that the join produces at most one output row for each row to be modified. In other words, a target row shouldn't join to more than one row from the other table(s). If it does, then only one of the join rows will be used to update the target row, but which one will be used is not readily predictable.
https://www.postgresql.org/docs/current/sql-update.html https://www.postgresql.org/docs/current/sql-update.html
- anarazel 6y agoThe release notes are directly referencing that they copied us / PG: "Support for UPDATE FROM following the PostgreSQL syntax. The sqlite folks have done that a few times, and I think that's good. No need to unnecessarily proliferate more variants of doing the same.