1. Requirements: Change the nickname in the review form to the last 4 digits of the mobile phone number.
UPDATE SET = MID (Issuer_name,4,6WHERE=One and like' 1% ';
2. Due to Misoperation (mid (issuer_name,4,6) is the middle 6 bits), data rollback is required.
3. Establish the intermediate table (and 1<>1 conditions do not meet the establishment of empty table)
create table TMP select T2. Reg_no,t2. Mobile,t1. ' Issuer_name ' from trans_eval t1,member T2 where t1.issuer_no t2. ' Reg_no ' 4 , 6 ) = t1. ' Issuer_name ' and 1 <> 1 group by T2. Reg_no,t2. Mobile,t1. ' Issuer_name ';
4. Import data into the intermediate table
INSERT into SELECT T2. Reg_no,t2. Mobile,t1. ' Issuer_name ' from trans_eval WHERE=t2. ' Reg_no ' and MID (T2 ' Mobile ',4,6=t1. ' Issuer_name ' GROUP by T2. Reg_no,t2. Mobile,t1. ' Issuer_name ';
5. Data recovery
SELECT * from tmp; UPDATE SET T2. ' Issuer_name '=WHERE t1. ' reg_no '=T2. ' Issuer_no ';
MySQL modifies 2 table ideas at the same time