Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

Interchange the value of a column Gender in a table where
values are Male and Female. So, where the value is Male, it
should changed to Female and Female to Male.

Answer Posted / ram

UPDATE TABLE
SET GENDER=(CASE GENDER
WHEN 'M' THEN 'F'
WHEN 'F' THEN 'M'
END) WHERE GENDER IN ('M','F')

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a join?

1112


What are the usages of sql?

1104


What are the different dcl commands in sql?

1235


Is big data nosql?

1000


What is the use of <> sql?

1040


How do you copy a table in sql?

1113


What is example of database?

1137


Can we create table inside stored procedure?

1017


Why do we use sql constraints? Which constraints we can use while creating database in sql?

1086


How is data stored in sql?

1105


Difference between truncate, delete and drop commands?

1145


How do I run a pl sql program?

1193


what are date and time data types in mysql? : Sql dba

1026


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

1177


How does a trigger work?

1149