Oupsla
Oupsla
DTDrizzle Team
Created by Oupsla on 7/22/2024 in #help
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;
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 ☀️
4 replies