Monday, March 22, 2010

To Swap Two distinct integers in a column with single SQL Query

Step 1 :
Create Table Say, tab and add a field val

Step 2 :
insert two integer values say 1 and 2

Step 3 :
Run this Query

update tab set val = (select min(val)+max(val) from tab)-val

For Swapping Two String  values Just Crawl on to
Ketan's Blog