mysql写法:
-- update...by  杨员外
update tabT t inner join tabF f 
on  t.ad=f.ad 
set 
 t.name=f.name,
 t.sex=f.sex;
 
 -- insert...by  杨员外
insert into tabT
(
ad,name,sex
)
select 
ad,name,sex
from tabF f where not exists(select 1 from tabT t where  t.ad=f.ad );
 
oracle写法:
 -- update...by  杨员外@2018 --
update tabT t set
(name,sex)
(select name,sex from tabF f where  t.ad=f.ad )
where exists(select 1 from tabF f2 where  t.ad=f2.ad );
 
 -- insert...by  杨员外@2018  --
insert into tabT
(
ad,name,sex
)
select 
ad,name,sex
from tabF f where not exists(select 1 from tabT t where  t.ad=f.ad );