将值从一个表插入到mysql中的另一个表
我有两张表,一张是表“a”,第二张是表“b”。在表“a”中,有五个字段,a_id 被指定为主键,在第二个表“b”中,有两个字段,b_id 被指定为主键。两个表中有一个共同的字段名称,如 cust_name。我的问题是当我在表“a”中插入值时,表“b”也应该填充相关列中的值。怎么可能。请帮助我。
i have two tables one is table 'a' and second is table 'b'. in table 'a' there are five feilds and a_id is assigned as primary key and in second table 'b' there are two feilds and b_id is assigned as primary key.there is one common feild name in both table as cust_name.my problem is when i insert value in table 'a' then table 'b' should also be filled with values in the respected column. how is it possible. plz help me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您需要一个 trigger 它将插入 b一旦一条记录插入到
It seems like you need a trigger that will insert into b as soon as a record in inserted in a