Home Forums SQL Server 2012 SQL Server 2012 - T-SQL how to update column city value from 'A' to 'B' and 'B' to 'A' in single query RE: how to update column city value from 'A' to 'B' and 'B' to 'A' in single query
Koen Verbeeck
SSC Guru
Points: 259085
More actions
September 25, 2013 at 1:25 am
#1652973
UPDATE myTable
SET City = CASE WHEN City = A THEN B
WHEN City = B THEN A
END
Need an answer? No, you need a questionMy blog at https://sqlkover.com.MCSE Business Intelligence - Microsoft Data Platform MVP