All Forums Tools
mehaboob 10 posts Joined 12/09
14 Jan 2010
inserting data into one table from multiple tables

hi i need to insert data into one table from 2 different tablesi m using like thisinsert into table1 values(firstname,phoneno,lastname)select fname,(select t2.phonenumber from table2 t2,table3 t3 where t2.firstname=t3.fname),lname from table 3;i am inserting firstname and lastname from table 3 and i m inserting phoneno from table2 but here i m getting a syntax error 3706 expected something between '(' ans 'select' keywordcan anyone help me plz................

kiran_terydata 13 posts Joined 09/09
15 Jan 2010

insert into table1 values(firstname,phoneno,lastname)select fname,(select t2.phonenumber from table2 t2,table3 t3 where t2.firstname=t3.fname),lname from table 3;insert into table1 (fname, pno, lname) values (sel t2.fname, t3.pno, t2.lname from table2 t2, table3 t3 where t2.fname=t3.fname);

You must sign in to leave a comment.