Reputation: 776
I am trying to run the following query
update IGNORE cs
set Value = '20934820843'
from admin.ConfigSupplemental as cs,
admin.Config as cc
where cs.ConsoleConfigID = cc.ID
and cs.Name = 'GetTime' and cc.Ctid = 200
I am getting the following exception:
Check the manual that corresponds to your MariaDB server version for the right syntax to use near ConfigSupplemental as cs
I also tried the below as well but I get the same error.
update IGNORE cs
set cs.Value = '2039482094380'
from admin.ConfigSupplemental cs
join admin.Config cc on
cc.ID = cs.ConsoleConfigID
where cs.Name = "GetTime"
and cc.Ctid = 200
Upvotes: 1
Views: 58
Reputation: 1269733
Here is the correct syntax for MySQL and MariaDB:
update admin.ConfigSupplemental cs join
admin.Config cc
on cs.ConsoleConfigID = cc.ID
set Value = '20934820843'
where cs.Name = 'GetTime' and cc.Ctid = 200;
You can add in the ignore
if you really intend it.
Upvotes: 1
Reputation: 133360
You have a cs alias after ignore and (from) table name in wrong position and from in update is not present.
Could be this way
update IGNORE
admin.ConfigSupplemental as cs
inner join admin.Config as cc on ( cs.ConsoleConfigID = cc.ID and cs.Name = 'GetTime' and cc.Ctid = 200)
set Value = '20934820843'
;
Upvotes: 1