Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other SQL Error – Help! Re: SQL Error – Help!

#137483
AndrewPham
Participant

Well, it didn’t tell me. It just said that I have an error. Anyway, the problem was that “SET” shouldn’t be used only at the start of the statement.
Like this:

UPDATE orders
SET status_comanda = CASE ID
WHEN 9 THEN ‘bun’
WHEN 8 THEN ‘nebun’
END,
nr_awb = CASE ID
WHEN 8 THEN ‘nebunicel’
END,
telefon = CASE ID
WHEN 7 THEN ‘666DA’
END,
genre = CASE ID
WHEN 6 THEN ‘M’
END
WHERE ID IN (9,8,7,6)