var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: Insert values from another table
Suppose I have this table
name | family_name | address
bob johnson 1212 albert st.
lori gaudio 2424 city square
Each of these fields are set to NOT NULL
I have another table with the same strucutre but no values in it.
I want to update the empty table with the values of the first table but only the name and family_name. I would like to set the adress to a default value like '1111 madison st' for all people.
If I do that :
insert into table2 (name, family_name) select name, family_name from table1
I get an error because it has to insert something in the address field (not null).
Thanks in advance,
insert into table2 (name, family_name,address) select name, family_name, '1111 madison st' from table1
You can sub '1111 madison st' with any defaul value you want to use in single quotes.
It works perfectly, thank you very much! :-)
It works perfectly, thank you so much! :-)