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...


One Table having two rows with one colomn having values
Like"Male" and "Female". how to upadte these values
Like "Female" and "Male" in single update statement.

Answers were Sorted based on User's Feedback



One Table having two rows with one colomn having values Like"Male" and "Female"..

Answer / murali mohan

Try this,


update testsamp1 set c=decode
(c,'MALE','FEMALE','FEMALE','MALE');


Regards,
Murali

Is This Answer Correct ?    8 Yes 1 No

One Table having two rows with one colomn having values Like"Male" and "Female"..

Answer / selvaraj anna university coe

UPDATE Eptbl SET Sex=DECODE
(Sex,'Male','Female','Female','Male');

Is This Answer Correct ?    8 Yes 1 No

One Table having two rows with one colomn having values Like"Male" and "Female"..

Answer / brahma prakash

Murali your answer is not running on postgres database

Is This Answer Correct ?    2 Yes 0 No

One Table having two rows with one colomn having values Like"Male" and "Female"..

Answer / manikanta

'DECODE' is not a recognized built-in function name in sql
server

Is This Answer Correct ?    2 Yes 0 No

One Table having two rows with one colomn having values Like"Male" and "Female"..

Answer / hitendra yadav

--Try this

UPDATE Eptbl
SET Sex= CASE WHEN SEX='Male'
THEN 'Female'
ELSE 'Male'
END;

Is This Answer Correct ?    1 Yes 0 No

One Table having two rows with one colomn having values Like"Male" and "Female"..

Answer / apsar

update tbl_name set (a,b) = (select b,a from tbl_name where a='Male');

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Oracle General Interview Questions

How to get execution path reports on query statements?

0 Answers  


Hi how Can I Add A Foreign key that references a table that has composit primary key ? example i had costumer table that has C_Id and SSN Both as PK and another table has C_Id that must refernece C_Id in Customers i done the usual way and got oracle error message about uniqeness any ideas plz

2 Answers  


What is a cognitive schema?

0 Answers  


Explain the difference between a procedure and a function?

0 Answers  


What is integrity and what is constraint??Explain with example

0 Answers   Google,


I just want to maintain data like an employee can belongs to 3 or more departments . We can resolve this by using composite key but it avoids normalization rules. So Can anyone tell me how can I maintain data.

0 Answers   IBM,


Explain cascading triggers.

0 Answers  


Define 'view' advantage ?

2 Answers   AZTEC, TCS,


How view is different from a table?

0 Answers  


How to assign values to data fields in record variables?

0 Answers  


can we pass two out parameters at a time in function?please answer to my question

3 Answers   Wipro,


What is the difference between substr & instr functions?

0 Answers  


Categories
  • Oracle General Interview Questions Oracle General (1809)
  • Oracle DBA (Database Administration) Interview Questions Oracle DBA (Database Administration) (261)
  • Oracle Call Interface (OCI) Interview Questions Oracle Call Interface (OCI) (10)
  • Oracle Architecture Interview Questions Oracle Architecture (90)
  • Oracle Security Interview Questions Oracle Security (38)
  • Oracle Forms Reports Interview Questions Oracle Forms Reports (510)
  • Oracle Data Integrator (ODI) Interview Questions Oracle Data Integrator (ODI) (120)
  • Oracle ETL Interview Questions Oracle ETL (15)
  • Oracle RAC Interview Questions Oracle RAC (93)
  • Oracle D2K Interview Questions Oracle D2K (72)
  • Oracle AllOther Interview Questions Oracle AllOther (241)