SQLのUPDATE
全recordのhoge columnを更新
code:sql
UPDATE <table_name>
SET hoge = 42;
条件指定
code:sql
UPDATE <table_name>
SET hoge = 42;
WHERE name = 'piyo'
複数set
code:sql
UPDATE <table_name>
SET hoge = 42,
fuga = 'pyono'
WHERE name = 'piyo';
こう書いても同じ
code:sql
UPDATE <table_name>
SET (hoge, fuga) = (42, 'pyono')
WHERE name = 'piyo';