MySQL2008. 11. 4. 11:59

<!--StartFragment-->CREATE TABLE member(
id varchar(30) not null,
name varchar(30),
cnt integer ,
primary key(id)
);

insert into member values ('aaaa','강만수',10);
insert into member values ('bbbb','강천수',11);
insert into member values ('cccc','강백수',12);
insert into member values ('dddd','강조수',13);
insert into member values ('eeee','강억수',14);

CREATE TABLE member_new(
id varchar(30) not null,
cnt integer,
primary key(id)
);


insert into member_new values('bbbb',129);
insert into member_new values('cccc',130);
insert into member_new values('dddd',131);


UPDATE member A, member_new B SET A.cnt=B.cnt WHERE A.id=B.id;
Posted by 아마데우스