How do I take an entire columns worth of data and put it into anther
column using a WHERE clause?
I have two extremely similar tables in the same database. I want to take
the entire 'visual' column from the table p992_cq31n06-cm16-x and put it
into the 'visual' column of the table p992_cq31n06-cu67-x where the
columns 'print' and 'id3' match up.
Here is the query I was going to run:
UPDATE `p992_cq31n06-cu67-x`
SET visual = (
SELECT visual
FROM `p992_cq31n06-cm16-x`
WHERE
`p992_cq31n06-cu67-x`.print = `p992_cq31n06-cm16-x`.print
AND
`p992_cq31n06-cu67-x`.id3 = `p992_cq31n06-cm16-x`.id3);
Is this going to work the way I want it to?
No comments:
Post a Comment