SQLize Online / PHPize Online  /  SQLtest Online

A A A
Share      Blog   Popular
Copy Format Clear
create table tmpContract ( a int, TechOverStartDate varchar(12) ); create table tmpContract2 ( a int, TechOverStartDate varchar(12) ); insert into tmpContract (a,TechOverStartDate ) select 1, '19000101'; insert into tmpContract (a,TechOverStartDate ) select 2, '19000101'; insert into tmpContract2 (a,TechOverStartDate ) select 1, '19000102'; insert into tmpContract2 (a,TechOverStartDate ) select 2, '19000101'; select * from tmpContract t1 inner join tmpContract2 t2 on t1.a = t2.a where t1.a = 1; UPDATE tmpContract SET TechOverStartDate = t2.TechOverStartDate FROM tmpContract t1 inner join tmpContract2 t2 on t1.a = t2.a where t1.a = 1; /*UPDATE tmpContract SET TechOverStartDate = t2.TechOverStartDate FROM tmpContract2 t2 --inner join tmpContract t2 where tmpContract.a = t2.a and tmpContract.a = 1; */ select * from tmpContract; --drop table tmpContract --drop table tmpContract2

Stuck with a problem? Got Error? Ask ChatGPT!

Copy Clear