EXL Interview Questions| Data Subsets
Question
Suppose that you have table Employee with a column EName which contain Records Employee name(EName) as A,B,A,A,B,D,C,M,A,
Write a query that will change/Swap the EName A to B and B to A.
in progress
0
Statistics
55 years
3 Answers
1353 views
Great Grand Master 0
Answers ( 3 )
select case when EName = “A” then “B” when name=”B” then “A” else EName end Enames from Records;
select
CASE
WHEN Ename =’A’ then ‘B’
WHEN Ename =’B’ then ‘A’
ELSE Ename
END as Ename
FROM Employee;
Select
CASE
WHEN Ename = ‘A’ then ‘B’
WHEN Ename = ‘B’ then ‘A’
Else Ename
End as Ename
from Employee;