Here is an example to understand it precisely:
SELECT
(CASE when roles.code = 'MAIL' THEN '1'
when roles.code = 'BUSIN' THEN '2'
when roles.code = 'HOME' THEN '3'
when roles.code = 'TEMP' THEN '4'
ELSE '5'
END) CODE_ALIAS
FROM addres addss,
roles roles
WHERE roles.addss_refno = addss.addss_refno
AND roles.refno = 3889027
AND addss.adtyp = 'POSTL'
--AND roles.code = 'MAIL'
AND roles.start_dttm <= SYSDATE
AND ( roles.end_dttm > SYSDATE
OR roles.end_dttm IS NULL )
AND roles.archv = 'N'
AND addss.ARCHV = 'N'
order by roles.code desc;
The output was displayed with an Alias == CODE_ALIAS
No comments:
Post a Comment