SQLite Forum

Feature request: extensions to UPDATE
Login
The developers have already discussed (internally) adding these features
for 3.33, using the PostgreSQL syntax.

The way you do this now is:

~~~~
       REPLACE INTO TableA SELECT ... FROM ...;
~~~~

See for example the Fossil code at
<https://fossil-scm.org/fossil/artifact/414c5b8e0150?ln=983-990>.
This code seems like it would be easier to read and understand if
it were written like this:

~~~~~
    UPDATE description
       SET summary=CASE WHEN plink.isprim THEN ''
                   ELSE 'merge '
                   END || 'parent of checkin',
           ref=blob.uuid
      FROM plink, blob
     WHERE description.summary='unknown'
       AND plink.cid=description.rid
       AND blob.rid=plink.pid;
~~~~~