inserting values from select query
-
hi guys i have one insert query in which i am selecting values from another table and then insert it in first table Query is like this. table1 table2 userid group id groupid group name i have values of userid and groupname insert into table1 (userid,groupid) values (userid,select groupid from table2 where groupname="temp")) it is not working so if anyone knows how to do it please help me out DJ
-
hi guys i have one insert query in which i am selecting values from another table and then insert it in first table Query is like this. table1 table2 userid group id groupid group name i have values of userid and groupname insert into table1 (userid,groupid) values (userid,select groupid from table2 where groupname="temp")) it is not working so if anyone knows how to do it please help me out DJ
insert into table1(userid,groupid) select userid, groupid from table2 where groupname="temp"
cheers, Neil