clear markdown compare help best fiddles feedback
clear markdown feedback
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 3601517 fiddles created (47951 in the last week).

select version();
version()
10.2.27-MariaDB-10.2.27+maria~jessie-log
 hidden batch(es)


create table variations (id int unsigned primary key, name varchar(30), quantity int unsigned);
 hidden batch(es)


insert variations (id, name, quantity) VALUES (1, 'John', 1), (2, 'Amy', 2), (3, 'Elizabeth', 3)
 hidden batch(es)


select * from variations
id name quantity
1 John 1
2 Amy 2
3 Elizabeth 3
 hidden batch(es)


INSERT INTO variations (id, name, quantity) VALUES (1, 'John', 4), (2, 'Amy', 5), (2, 'Elizabeth', 6) ON DUPLICATE KEY UPDATE id=VALUES(id), name=VALUES(name), quantity=VALUES(quantity)
 hidden batch(es)


select FOUND_ROWS(), row_count();
FOUND_ROWS() row_count()
3 6
 hidden batch(es)


select * from variations
id name quantity
1 John 4
2 Elizabeth 6
3 Elizabeth 3
 hidden batch(es)