Update Male TO Female and Female To Male with single query

By Satyapriya Nayak Apr 09, 2013
Update Male TO Female and Female To Male with single query
UPDATE    employee
SET             
gender = CASE gender WHEN 'male' THEN 'female' WHEN 'female' THEN 'male'
ELSE gender
END
Satyapriya Nayak

Satyapriya Nayak is a software developer from Bhubaneswar, India. He holds a Bachelor's degree in Electronics and telecommunication and is an active member of C# Corner. 

COMMENT USING

PREMIUM SPONSORS

Hire Mobile & Web Developer on demand. 100% satisfaction. Try for 1 week or Money Back. Local and remote developers available all over USA.

Latest Blogs