【发布时间】:2014-11-26 21:17:43
【问题描述】:
我有 3 个 MySQL 表:table1、table2、table3。我正在尝试从 table1 和 table2 中提取特定内容,然后通过使用触发器将此提取的内容插入到 table3 中。每当数据插入 table1 时,我希望触发器插入这条新记录
CREATE trigger 'test_trigger' after insert on 'table1'
select a.fname, a.lname,b.address,b.contact
from table1 a
inner join table2
on a.table1_id=b.table2_id
insert into table3(fname,lname,address,contact)
END;
【问题讨论】: