Set s.c ity_name=c.n ame
Where s.c ity_code=Arthur c. ode;
This method will cause the city locked, what solution can be avoided, reducing the MySQL data isolation level is the best?
CodePudding user response:
Don't understand your business logic, if the student. The code is number type, you can try this,DECLARE
The begin
FOR i IN 0.. 99 LOOP
Update student s, city c
Set s.c ity_name=c.n ame
Where s.c ity_code=Arthur c. the ode and mod (s.c ity_code, 100);
END LOOP;
end ;