My table A contains the field AB, and some of the data is reversed. How to change it for help: I have A field AB in Table A, and now some data is reversed. How can we replace the data in B to be updated to. (I will write the next one. ------ Solution ------------------ SQLcodeset @ tmp & quot; up for help: I have A local field a B in Table A, and now some data is reversed. How to Change
My table A contains the local field a B. Now some data is reversed. How to Change
That is, data in B is stored in update to. (I will write the next one.
------ Solution --------------------
SQL code
Set @ tmp = ""; update table set field_a = (@ tmp: = field_a), field_a = field_ B, field_ B = @ tmp where ......
------ Solution --------------------
We recommend that you use sqlyog to directly execute multiple statements. Http://download.csdn.net/detail/dmtnewtons/4230136
SQL code
Update A set A. a = "new_data_a", A. B = "new_data_ B" where A. a = "old_data_a" and A. B = "old_data_ B ";......
------ Solution --------------------
Changed the field name.
------ Solution --------------------
Great!
Discussion
SQL code
Set @ tmp = "";
Update table set field_a = (@ tmp: = field_a), field_a = field_ B, field_ B = @ tmp where ......