将值从一个表插入到mysql中的另一个表

发布于 2024-09-24 17:47:19 字数 154 浏览 0 评论 0原文

我有两张表,一张是表“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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

傲娇萝莉攻 2024-10-01 17:47:19

看来您需要一个 trigger 它将插入 b一旦一条记录插入到

It seems like you need a trigger that will insert into b as soon as a record in inserted in a

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文