Compute..By
In
general we are not allowed to use group or aggregate functions after table name
except with having clause .
By
using this clause you can perform group or aggregate functions after table name .
Ex:
*
Select * from emp compute min(start_date)
*
Select * from emp order by region compute min(hire_date) by job
*
select * from emp compute sum(sal),avg(sal),min(sal)
Notes
The data within
anglerbrackets(<>) is compulsory , where as in square brackets [] is
optional in database sub-language
The
query execution order is FROM-->T.N-->*-->WHERE
The
Precedence of clauses is Top > Group
By> having > Order By > Compute By
Thanks for posting this option . It is very useful and time saving option with minimal code.
ReplyDelete