mysql - Command to insert into with select -
i have table:
create table student(name varchar(20), surname varchar(20), age int);
first, insert table fields:
insert student values ("jhon", "smith", null); insert student values ("mark", "william", null);
now, how insert age=28 name = 'jhon'??
you have use update below :
update student set age = 28 name = "jhon";
notice : it change age of people name = "jhon"
it's far better define primary key (id) column perform commands specific id.
Comments
Post a Comment