I would like to compare two tables and then update if some logic is true,
In pseudo code:
SELECT * FROM users, usersold IF users.id=usersold.id THEN UPDATE users.status=1;
Is there a way to do it in MySQL?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Alternate version:
You should test and, depending on your database, you may find one performs better than the other although I expect any decent database will optimize then to be much the same anyway.