Knowledge sharing....
SET @value1 = 'b'SET @value2 = 'a'UPDATE table1 SET val = REPLACE(@value1 + @value2,val,'')select REPLACE(@value1 + @value2,val,'') from table1
Even simple way to update the value as follows :update table1 set Column1 = Case when 'a' then 'b' When 'b' then 'a'end
SET @value1 = 'b'
ReplyDeleteSET @value2 = 'a'
UPDATE table1 SET val = REPLACE(@value1 + @value2,val,'')
select REPLACE(@value1 + @value2,val,'') from table1
Even simple way to update the value as follows :
ReplyDeleteupdate table1
set Column1 =
Case when 'a' then 'b'
When 'b' then 'a'
end