Answer the question
In order to leave comments, you need to log in
How to write SQl query for data recovery?
There are two tables, one backup is not the other.
woodfun.toys_users has two fields company and inn where all records have the same data .
And there is a backup from the day before yesterday.
You need to update all the data from the ghujgu table to the woodfun table where company=`SP Kolya1` and inn=`1234567891`.
I decided to make a SQL query:
UPDATE SET toys_users = ghujgu.toys_users WHERE `toys_users`.`company` = `IP Kolya1` AND ghujgu.`toys_users`.`inn` =`1234567891` .
Error :
Error Code: 1064
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET toys_users = ghujgu.toys_users WHERE `toys_users`.`company` = `IP Kolya' at line 1
Answer the question
In order to leave comments, you need to log in
Hello.
To begin with, once again make a backup of all the tables included in the query)) so that if anything, it's not my fault.
And then try this query:
UPDATE woodfun.toys_users AS w, ghujgu.toys_users AS g
SET
w.email = g.email,
w.name1 = g.name1,
w.name2 = g.name2,
и так далее
w.discount = g.discount
WHERE w.id = g.id
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question