insert into c ( select * from a where not exists (select * form b where id=a.id) union all select * from b where not exists (select * form a where id=b.id))
CREATE PROCEDURE procTabC_AddRecords as insert into c( select * from a where not exists (select * form b where id=a.id) union all select * from b where not exists (select * form a where id=b.id))你最好還是把三個表關聯的字段寫出來!
select * from a where not exists (select * form b where id=a.id)
union all
select * from b where not exists (select * form a where id=b.id))
as
insert into c(
select * from a where not exists (select * form b where id=a.id)
union all
select * from b where not exists (select * form a where id=b.id))你最好還是把三個表關聯的字段寫出來!