I'm very puzzled because when I'm running this query on SQLite.
On MacOS Mojave SQLITE, I'm getting a syntax error on the on "FROM". There is no more detail.
This does work on Postgres.
Am I reading the SQLite documentation the wrong way? https://sqlite.org/lang_update.html
Here's the query:
BEGIN;
-- Statement 1
CREATE TEMP TABLE tempEdits (identifier text, serverEditTime double precision);
-- Statement 2
INSERT INTO tempEdits (identifier, serverEditTime)
VALUES
('uuid1', 1.5),
('uuid2', 2.2),
('uuid3', 3.3);
-- Statement 3
UPDATE
"pEdits"
SET
"serverEditTime" = t.serverEditTime
FROM
"pEdits" AS e JOIN tempEdits AS t ON e.identifier = t.identifier
WHERE
e.identifier = t.identifier;
END;
Setup query:
CREATE TABLE "pEdits" (identifier text, serverEditTime double precision);
INSERT INTO (identifier)
VALUES
('uuid1'),
('uuid2'),
('uuid3');