I would like to upsert data to a table in SQLite, but the column being updated (if the record is found) must be a running total. I am using a parameterized query, and am having
OK so this is working for me:
INSERT OR REPLACE INTO TABLE (ID, Quantity) VALUES (:ID, COALESCE( (SELECT Quantity FROM TABLE WHERE ID = :ID) + :Quantity_change, :Quantity_change));
Thanks to this SO link for the help.