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

CREATE TABLE A (col1 varchar(10), col2 varchar(10), col3 varchar(10));
 hidden batch(es)


CREATE TABLE B (col1 varchar(10), col2 varchar(10), col3 varchar(10));
 hidden batch(es)


INSERT INTO A (col3) VALUES ('1');
 hidden batch(es)


INSERT INTO B (col3) VALUES ('1'), ('2'), ('3');
 hidden batch(es)


SELECT * FROM A;
col1 col2 col3
1
 hidden batch(es)


SELECT * FROM B;
col1 col2 col3
1
2
3
 hidden batch(es)


UPDATE A, B SET A.col1 = 'abc', A.col2 = 'xyz', B.col1 = CASE B.col3 WHEN '1' THEN 'a' WHEN '2' THEN 'b' WHEN '3' THEN 'c' END, B.col2 = CASE B.col3 WHEN '1' THEN 'x' WHEN '2' THEN 'y' WHEN '3' THEN 'z' END WHERE A.col3 = '1' AND B.col3 IN ('1', '2', '3') ;
 hidden batch(es)


SELECT * FROM A;
col1 col2 col3
abc xyz 1
 hidden batch(es)


SELECT * FROM B;
col1 col2 col3
a x 1
b y 2
c z 3
 hidden batch(es)