标签:style blog http color io ar 数据 sp div
update B,A set B.memo=A.memo
where A.order_id=B.order_id and (B.memo is null or B.memo=‘‘);
create table A ( order_id int not null auto_increment, operator varchar(50), oper_date date, memo varchar(50), primary key(order_id) ); create table B ( order_id int not null auto_increment, good_id int, good_code int, good_name varchar(50), memo varchar(50), primary key (order_id) ); insert into A values (1,‘onion2‘,now(),‘测试1‘), (2,‘onion2‘,now(),‘测试2‘), (3,‘onion3‘,now(),‘测试3‘); insert into B values (1,1,0001,‘good1‘,‘已经备注‘); insert into B (order_id,good_id,good_code,good_name) values (2,2,0002,‘good2‘), (3,3,0003,‘good3‘); update B,A set B.memo=A.memo where A.order_id=B.order_id and (B.memo is null or B.memo=‘‘);
标签:style blog http color io ar 数据 sp div
原文地址:http://www.cnblogs.com/huangcongcong/p/4004296.html