i have one student table
stu id sex coloums
1 male
2 female
3 female
4 male
5 female
i want retrieve the table male as female and female as male


want the result table liek this

stu id sex
1 f
2 m
3 m
4 f
5 m
can anyone tell me the query for this plz

SELECT ID, CASE Sex
WHEN 'male' THEN 'F'
WHEN 'female' THEN 'M'
END
"Sex",
FROM stu

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.