MySQL 5.5: Efficient way to copy the same user information with different IDs
问题 In MySQL 5.5, assume we have the following MAIN table Id Name Score 3 a 100 3 b 99 4 c 98 4 d 97 Also a SUB table: Id New_Id 3 1 3 1 4 2 4 2 The ideal output is OUTPUT table: Id Name Score 3 a 100 3 b 99 4 c 98 4 d 97 1 a 100 1 b 99 2 c 98 2 d 97 The MySQL fiddle is available here http://sqlfiddle.com/#!9/91c1cf/6 In the OUTPUT table, we can see that the Id=1 shares the same information as Id =3. Similarly, we can see that the Id=2 shares the same information as Id =4. Is there any simple way