J
J
jeston2011-01-20 22:03:25
MySQL
jeston, 2011-01-20 22:03:25

Question about UPDATE data from another table in MySQL?

I have table1 with fields (A,B,C) and table2 with (D,B,C), A and D are rows
I want to update table1 like this (using phpMyAdmin)
UPDATE atm
SET
table1.B = table2. B
WHERE
table1.A=table2.D
When I run it, I get an error that, say, table2.B is an unknown column.
How to overcome it?
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
adminimus, 2011-01-20
@adminimus

Did you copy everything correctly? Table2.B does not appear in your query at all :)
Try this: UPDATE table1, table2 SET…

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question