dharkangel
MIS
Hi,
I have two tables, Table1 has two columns called Username, Role. Table2 has two columns called Assigned_To and Role. I am trying to do something like this:
INSERT INTO Table2
SELECT Role AS Role
FROM Table1
WHERE Table1.UserName = (SELECT Assigned_To FROM Table2);
This didn't work, but is it possible to do something like this? Should I be using a join? The columns Username and Assigned_To have the same values. I'm trying to extract the Role value from Table1, by matching it to a value in Table 2, then insert into Table2.
thank you
I have two tables, Table1 has two columns called Username, Role. Table2 has two columns called Assigned_To and Role. I am trying to do something like this:
INSERT INTO Table2
SELECT Role AS Role
FROM Table1
WHERE Table1.UserName = (SELECT Assigned_To FROM Table2);
This didn't work, but is it possible to do something like this? Should I be using a join? The columns Username and Assigned_To have the same values. I'm trying to extract the Role value from Table1, by matching it to a value in Table 2, then insert into Table2.
thank you