楼主 都不对 一个是插入 一个是条件 没有查询语句
insert into sms(id)
select id from tb
where t1.id = t2.id
--or t1.name = t2.name
you can try this :
1.table sms must not exist!
select t1.id into sms from t1,t2 where t1.id = t2.id or t1.name = t2.name
2.table sms must be existing!
insert into sms(t1.id) select t1.id from t1,t2 where t1.id = t2.id or t1.name = t2.name