Basically, what I want to do is the following : I have a table 'users' in my first database (prc), like this :
prc.user : id_user : 45 | name_user : Test | login_user : test | pwd_user : test [...]
And in my second database (named : prc_test)
prc_test.user id_user : 45 | name_user : Test | login_user : test | pwd_user : test [...]
The thing I want to do, is update all the "pwd_user" fields in "prc_test.user" with the values from pwd_user from "prc.user" But in the prc_test.user, the id are not the same as in prc.user, so I thought of doing it with the "name_user", (there are no doubles).
Any clue in how I can do it ? I searched on Google, but what I found is always for some specific cases, or for insert statements...
(I'm using MySQL5.5)
Thanks !
INSERT INTO SQL statement is used to insert data from one database table to another. The INSERT INTO can be used to transfer data from one database to other database or between two tables in the same database.
UPDATE prc.user, prc_test.user SET prc_test.user.pwd_user = prc.user.pwd_user WHERE prc_test.user.name_user = prc.user.name_user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With