Update values from one column in same table to another in SQL Server Update values from one column in same table to another in SQL Server sql-server sql-server

Update values from one column in same table to another in SQL Server


This works for me

select * from stuffupdate stuffset TYPE1 = TYPE2where TYPE1 is null;update stuffset TYPE1 = TYPE2where TYPE1 ='Blank';select * from stuff


UPDATE aSET a.column1 = b.column2FROM myTable a INNER JOIN myTable bon a.myID = b.myID

in order for both "a" and "b" to work, both aliases must be defined


UPDATE TABLE_NAME SET COLUMN_A = COLUMN_B;

Much easier. At least on Oracle SQL, i don't know if this works on other dialects as well.