Drizzle TeamDT
Drizzle Teamโ€ข2y ago
Oupsla

Alias values rows in insert with mysql

Hello ๐Ÿ‘‹

The use of "VALUES()" is deprecated in "ON DUPLICATE KEY" statement when inserting multiple values. (source: https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html#:~:text=Note,of%20this%20section.)

Now you have to alias values like that
INSERT INTO t1 (a,b,c) VALUES (1,2,3),(4,5,6) AS new
  ON DUPLICATE KEY UPDATE c = new.a+new.b;


Do you know if it is possible to do that with Drizzle ?

Have a nice day โ˜€๏ธ
Was this page helpful?