I want to change data from different columns with different values. Should I use loop in nodejs and run the query for each data? or there is another query which can fulfill this requiremnt. I have users table. Now i have to change the name of two users. In the given code i want to change the name of user with id=1
to name1
and the user and the user with id=2
to name2
. The following query generating error. What is the right way and syntax to do such a thing.
UPDATE
UsersTable
SET
`names` =('name1', 'name2')
WHERE
id IN(1, 2)
1条答案
按热度按时间wz1wpwve1#