##値のバインドとサブクエリのみで直接のFROM句は無し
INSERT INTO hoge_tbl (val1, val2, val3, val4) SELECT 1, 'hoge', 'hogehoge', (SELECT MAX(`val4`) FROM hoge_tbl WHERE val1 = 2);
Go to list of users who liked
More than 5 years have passed since last update.
##値のバインドとサブクエリのみで直接のFROM句は無し
INSERT INTO hoge_tbl (val1, val2, val3, val4) SELECT 1, 'hoge', 'hogehoge', (SELECT MAX(`val4`) FROM hoge_tbl WHERE val1 = 2);
Register as a new user and use Qiita more conveniently
Go to list of users who liked