SQLite Forum

Switching data between two columns
Login
Think of SQLite behaving as if it were doing

REPLACE INTO <table> (... c3, c4, ...) SELECT ... c4, c3, ... FROM <table>;

i.e. a new record is built using the values from the old record plus any replacements from the UPDATE list before the new record overwrites the old record.