SQL Inline View

Inline View

Inline View :- Query , that is used in place of table name (front of From) is called a Inline-view. This query work as a logical table(view) that's why this is called inline view.

Syntax :- select * from () where ;

In above syntax , is a inline view

Example:-

select * from (select empno,ename,job,sal from emp where sal>2000) ;

Here "select empno,ename,job,sal from emp where sal>2000" is a inline view.


select empno,ename,job,sal,drank from (select empno,ename,job,sal,dense_rank() over(order by sal desc) drank from emp)
where drank<=3;

Note:- Query coloured with blue is inline-view.

No comments:

Post a Comment