-
create table emp ( ename varchar2(20),
empno varchar2(10),
job varchar2(20),
hiredate date,
salary number (10,2),
comm number (10,2));
Then insert rows
create view emp_view as (
select ename, empno, job, hiredate,
decode ( ename, user, sal, 'KING',sal, 0) as sal,
decode ( ename, user, comm, 'KING', sal, 0) as comm
from emp);
I understand the basic decode( ename, 'kevin', MANAGER)
as if ename equal kevin then replace with MANAGER, but I don't understand decode( ename, user, sal, 'KING',sal, 0) as sal,
Please explain... thank you
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|