表:t1,t2
t1: tname,tdq
t2:tname,tdq,.....
如:t1中
taname tdq
a b
c b
dd d
t2中:
tname tdq
a b
cc b
dd d
则t1
tname tdq
a b
c b
cc b
dd d
如何做试试
insert into t1 select * from t2 where not exists (select * from t1 where tname = t2.tname)select * from t1 union select * from t2
你是想把表2中在表1中没有的数据插入到表1中么?