1. Inline views we are using sub query’s in place of tablename with in parent query.
2. In all database systems we are not allowed to use Order By clause in child query’s.
3.
To overcome this problem sub query’s in from
“from” clause.
4.
These type of query’s are also called as “
INLINE QUERY’s”.
5. Generally, in oracle we are not allowed to use “Alias name” in “where” condition.
6. To overcome this problem also we are using “Inline views”.
7.
Whenever we are using “Inline views” this
alias name automatically behaves like column name, then only this alias name we
can use in “where” condition.
Query 1:
select * from (select ename,sal,sal*12 annsal from emp) where annsal>30000;
Query 2:
select * from dept,
(select deptno,round(avg(sal),2) avg_sal from emp group by deptno);
Query 3:
select * from dept,
(select deptno,round(avg(sal),2) avg_sal from emp group by deptno)d where d.deptno=dept.deptno;
No comments:
Post a Comment