SQLite Forum

Parse failure doing UPDATE FROM
Login
I'm trying to do an UPDATE FROM and getting a parse failure I don't understand.  I'm wondering if anyone can explain what I'm doing wrong.  SQLite 3.23.1, built from the amalgamation.

Using the command-line shell, I do (if I've copied it correctly)

ATTACH '../customers/cust.db' AS cdb; UPDATE idmap SET btn = c.foo FROM (SELECT servID AS userId, btn AS foo FROM cdb.live GROUP BY userId, btn HAVING COUNT(*) = 1) AS c WHERE c.userId = idmap.userId

and I get

Error: near "FROM": syntax error

The subquery works fine when run on its own.  I've been staring at the syntax for UPDATE and so far have been unable to see my mistake.