Not sure if this is a basic question or not but I can’t seem to figure out the syntax.
I have one table called leads – primary key LeadsId and another table rep_assign with prime key lead_id.
I want to store rep_id, which is a field located in rep_assign, in to the leads table where leads.LeadsId = rep_assign.lead_id.
Anyone know how? I just want to move the data from one table to another where LeadsId is equal to lead_id.
I’ve tried SELECT INTO and INSERT INTO a couple of ways but I can’t seem to get it to work.
Thanks for your help.
It sounds like both of your tables already have most of the data in them. Perhaps you just need to update the leads table to add the rep_id.
N.B. subqueries like this work in most RDBMSs, but not all. If this doesn’t work for you, it would help if you could tell us what RDBMS you’re using (e.g. MySQL).