Sample Header Ad - 728x90

How database engine of SQL swap two columns values?

6 votes
3 answers
2359 views
I want to swap values of two columns in a table, And I found that in SQL we can do that by using Update:
update the_table set first_name = last_name, last_name = first_name;
It works But I wonder How SQL can do that without **overwrite** data in a column of other column?
Asked by TAHER El Mehdi (292 rep)
Sep 27, 2022, 07:45 PM
Last activity: Feb 18, 2023, 10:23 PM