There is a table which contains all the employee details,
unfortunately there is mistake occured while entering the
data.
ex:
-------------------------------
empid empname gender address
-------------------------------
1 abcd f address1
2 defg m address2
3 ghth m address3
4 jkil f address4
write a update query that will change gender 'm' to 'f'
and 'f' to 'm'

Answers were Sorted based on User's Feedback



There is a table which contains all the employee details, unfortunately there is mistake occured w..

Answer / guest

update employeedetails
set gender='m'
where gender='f'
update employeedetails
set gender='f'
where gender='m'

Is This Answer Correct ?    2 Yes 2 No

There is a table which contains all the employee details, unfortunately there is mistake occured w..

Answer / shahbaz maqsood

It isn't possible to me to write a single query.You can first assign another value like 'a' to one of two values.Then assign your required value to the other

"update table set gender='f' where gender='m'"

"update table set gender='m' where gender='a'"

Is This Answer Correct ?    1 Yes 2 No

Post New Answer

More Programming Languages AllOther Interview Questions

what does mean and stack mean in genral programming?

0 Answers  


how can i apply validation without using errorprovider in C# windows application

1 Answers  


how will you do destructive read and non destructive read in data queue.....

0 Answers   CTS,


can any method return type may be constructor , or that method name allow

0 Answers   HCL,


what is inprocess and outprocess in vb

1 Answers   Msoft,






i want to open a helkp file that is txt file on link buttons click

1 Answers  


can we retrieve only integer/String type columns from a table,if yes how?

0 Answers  


If i have a dataset queried from Sql and I would like to insert the dataset into a specific node in an xml document how do I do this

0 Answers   SGT,


sample and simple coding where we get?

0 Answers   IBM,


Why we need new operator in java at the time of object declaration and why not in c++?

1 Answers   Zensar,


I am work in it aompenei

0 Answers   Access Healthcare,


hi i am jyoti i have done sap training in sd and master degree in economics have 2 year exp as enduser in (gdms)and 1 year as sd consultant.as contract basis now what i can do for getting job in it industry

0 Answers   HCL,


Categories