I was trying to insert profile id and userid into a table but, by mistake, I inserted profileid into userid, since table was having thousands of records, thinking of changing every row was a difficult task. I found an easier solution, instead of changing rows value, I thought to Swap Column values and I did it, just by using simple MySql query.
UPDATE TABLE_NAME SET userid =(@temporary:= userid), userid = profileid, profileid = @ temporary;
Above query will swap values of two columns and you don’t need to worry about rows.
Hope this post help you guyz. If you found this post helpful do hit the like button and share with others.