开发者

insert values from one table to another table in mysql

开发者 https://www.devze.com 2023-01-17 01:34 出处:网络
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 assi

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 ins开发者_开发百科ert value in table 'a' then table 'b' should also be filled with values in the respected column. how is it possible. plz help me.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消