Swap values between two columns
784247May 10 2011 — edited May 10 2011I have a table MEMBERS_SYSTEMS_ID of which three columns are ID, B1, B2.
I need to swap the values between B1 & B2 for particular values of ID.
Iam trying the following but it doesnt work , Please help fix this +[If you can also tell why my SQL is not working that would be great]+
BEGIN
DECLARE temp varchar(50)
UPDATE MEMBERS.MEMBERS_SYSTEMS_ID
SET temp =B2,
B2 =B1,
B1 =temp
WHERE ID IN ('85','86');
END