Functions to be achieved: The price listed salary table replace lost pay row shop table?
(The price list of commodities and commodity composition of a new table)
Table A: shop:
Table B: salary:
Solution:
Method one: create a new table, multi-table queries
create table Shopping_list(select id,type,product,shoper,orderdate,price from shop,salary where shop.id = salary.id1);
Method two: create a new table, the connector
create table Shopping_list(select id,type,product,price,shoper,orderdate from shop join salary on shop.id = salary.id1);
Method three: directly in the original table is updated, so that a full update to one another table
update shop1 set pay = (select price from salary where salary.id1 = shop1.id);