表的结构如图,其中id分别是主键,想要实现在user表中填写id和其他信息,other表自动生成与user表相同的id。
使用插入触发器 https://www.cnblogs.com/carbon3/p/5920417.html
delimiter //create trigger same_id_triafter insert on userfor each rowbegininsert into other set id = new.id;end;//