sql - Insert values from one table to another -


have 2 table. tbl1:

col1    col2    col3             alex 

and tbl2 :

id        name  1         john  2         nen  3         bob 

want enter names in tbl2 tbl1 col3, col1 , col2 must former, example want :

  col1  col2    col3                 alex                 john                 nen                 bob 

i try :

insert tbl1(col1,col2,col3) values('a','a',(select name tbl2)) 

but have error : subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression

you can try this...

insert tbl1(col1,col2,col3) select 'a','a',name tbl2 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -