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 / parli jain

Update table_name
set Gender = decode (Gender, 'M', 'F', 'F,'M')
where Gender In ('M','F');

Is This Answer Correct ?    29 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the sql query to display the current date?

758


What is use of trigger?

677


Does oracle use sql?

685


Does sap use sql?

717


what is a materialized view? : Sql dba

753






What is view? Can we update view

1081


i have a column which may contain this kind of value: 123*67_80,12*8889_5,34*8_874 ,12*7_7 (can contain space before a comma, and this string length can be anything) now i want to split this value into two column like: column1: 123*67,12*8889,34*8,12*7 column2: 80,5,874,7 use function for this

1279


How many types of sql are there?

719


What do you understand by pl/sql cursors?

741


What is the basic structure of an sql?

758


What does select count (*) mean in sql?

740


What are inner outer left and right joins in sql?

733


Which join is like inner join?

762


what is user defined functions? : Sql dba

744


What is rename in sql?

728