qlite] Syntax error using CTE and UPDATE
One last thing I forgot to mention, on the topic of making INSERT and
UPDATE easy -
If you are using SQLite 3.15 or later, you can use Row-value
functionality to UPDATE several fields in one go from a sub query.
An example of how such an update query might
One last thing I forgot to mention, on the topic of making INSERT and
UPDATE easy -
If you are using SQLite 3.15 or later, you can use Row-value
functionality to UPDATE several fields in one go from a sub query.
An example of how such an update query might look:
WITH CTE(ID, ta, tb, tc) AS
On 2017/09/04 12:46 PM, David Wellman wrote:
Hi Ryan,
Thanks for that. It is certainly valid syntax and I'll do some testing to check
that it gives me the correct answer.
It's always a pleasure.
Your email has 'crossed in the post' with my second one and you've answered
something that I
te-users@mailinglists.sqlite.org
Subject: Re: [sqlite] Syntax error using CTE and UPDATE
You are essentially trying to use a CTE (which for the intents and
purposes of the UPDATE SQL is just the same as using any other table)
inside an UPDATE statement as if it is the main referenced table.
I
I've been able to get my code runing by changing it to the following:
update relation
set wamapname = (select wrk.mapname
from waPSM_TABLE_MAPNAME_WRK as wrk
inner join relation as rel
on wrk.queryid = 1
and wrk.queryid = rel.queryid
You are essentially trying to use a CTE (which for the intents and
purposes of the UPDATE SQL is just the same as using any other table)
inside an UPDATE statement as if it is the main referenced table.
In an UPDATE or INSERT however, there can only ever be 1 single main
referenced table (i.e.
6 matches
Mail list logo