shahbaz maqsood


{ City } gujranwala
< Country > pakistan
* Profession * software developer
User No # 23911
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 1
Users Marked my Answers as Wrong # 2
Questions / { shahbaz maqsood }
Questions Answers Category Views Company eMail




Answers / { shahbaz maqsood }

Question { 4688 }

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'


Answer

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