Change Default Display

How to change the default display? For deptno 10 show "Financial Department", for deptno 20 show "Account Department", for deptno 30 show "Management Information System", for deptno 40 show "Electronic Data Processing"

Questions by shameem_chandu

Showing Answers 1 - 0 of 0 Answers

Kushy14

  • Jun 18th, 2010
 

SELECT DECODE (deptno,10,'Financial Department',20,'Account Department',30,'Management Information System',40,'Electronic Data Processing')
FROM dept;

  Was this answer useful?  Yes

kiran_marla

  • Jun 19th, 2010
 

Use decoding to display names.

select decode(deptno,10,'Financial Department',20,'Account Department',
30,'Management Information System',40,'Electronic Data Processing','Unknown') from dept;

or

select case deptno
when 10 then 'Financial Department'
when 20 then 'Account Department'
when 30 then ,'Management Information System'
when 40 then 'Electronic Data Processing'
else 'Unknown'
end
from dept;

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions