Sir, I need your help in the following topic.
I have a table named tbl_Person. It has columns: id(numeric(18,0), firstName(varchar(20), Gender(int).
please find the attached file with this for screenshot.
in that, I gave value 1 to Male and 2 to Female. Then all row with gender male show 1 and female with 2.
Now I want to change the Female corresponding number from 2 to 1 and male from 1 to 2.
Please give me the query to interchange the value of rows.
Loading

Jignesh TrivediPosted Oct 8, 2013, 5:43 AM
Try following query
UPDATE tbl_Person
set Gender = CASE WHEN Gender = 1 THEN 2 ELSE 1 END
hope this will help you....
venkata kumarPosted Oct 8, 2013, 5:53 AM
try what ever jignesh told