883 0 0 0
Last Updated : 2025-04-28 21:19:04
If you have a table and want to swap two field values together, here is a simple snippet.
UPDATE swap_test s1, swap_test s2 SET s1.x=s1.y, s1.y=s2.x WHERE s1.id=s2.id; //MYSQL SQL Query