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

  • UPDATE myTable

    SET City = CASE WHEN City = A THEN B

    WHEN City = B THEN A

    END

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP