1 year ago

#387978

test-img

user15473689

Update multiple columns with different WHERE and SET condition

Goal simplify I'm really sorry . but i'm looking almost all day (1h) if be honest. Just lost in information and no simple answer explain pls. if can. Thanks i want to update multiple columns this is my code can i simplify this code. this million lines of query works perfect made in exel in 20 min. this is update for joomla database.(copy/paste)

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445646","value":"64646"}}} 'WHERE id=104;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445647","value":"64647"}}} 'WHERE id=150;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445648","value":"64648"}}} 'WHERE id=121;

UPDATE fields SET fieldparams ='{"multiple":"","options":{"options0":{"name":"6445649","value":"64649"}}} ' WHERE id=137;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445650","value":"64650"}}} 'WHERE id=153;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445651","value":"64651"}}} 'WHERE id=169;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445652","value":"64652"}}} 'WHERE id=185;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445653","value":"64653"}}} 'WHERE id=201;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445654","value":"64654"}}} 'WHERE id=217;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445655","value":"64655"}}} 'WHERE id=233;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445656","value":"64656"}}} 'WHERE id=249;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445657","value":"64657"}}} 'WHERE id=265;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445658","value":"64658"}}} 'WHERE id=281;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445659","value":"64659"}}} 'WHERE id=297;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445660","value":"64660"}}} 'WHERE id=313;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445661","value":"64661"}}} 'WHERE id=377;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445662","value":"64662"}}} 'WHERE id=329;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445663","value":"64663"}}} 'WHERE id=345;

UPDATE fields SET fieldparams ='
{"multiple":"","options":{"options0":{"name":"6445664","value":"64664"}}} 'WHERE id=361;

sql

mariadb

set

sql-update

where-clause

0 Answers

Your Answer

Accepted video resources