Skip to content Skip to sidebar Skip to footer

How to swap two column values in SQL?

     In the following tutorial, we are learning about swapping two columns in SQL table.

Following example I am wrongly saved the data, and I need to swap these columns.

SQL swap two column values


So now I want to swap these columns data.

Syntax
     update  table_name set column1=column2,column2=column1;

Example:
     update Saved_LimitDetails set LLimit=ULimit,ULimit=LLimit;

After executing the about line the output is

Swap two column from sql table




Post a Comment for "How to swap two column values in SQL?"