I have a table which returns column values as AP, NAP, N/A
But when the user views it
I want AP to be transformed to Approved,
NAP to Not Approved
N/A to Pending.
Assume that your table is named 'TableA' and its columns are named 'A', 'B' and 'C'. Let the column 'C' contain values such as 'AP', 'NAP', 'N/A' etc. etc. You could make use of the case statement to achieve what you have asked for. The sample sql is furnished below.
Select A,
B,
case
when C = 'AP' then 'Approved'
when C = 'NAP' then 'Not Approved'
when C = 'N/A' then 'Pending'
end
from TableA
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.