slopeofhope slopeofhope - 24 days ago 4x
SQL Question

what is wrong with below sql update query?

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


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.