Tuesday, June 26, 2012

Aggregate and Analytic Functions in oracle

Aggregate functions :

1.Aggregate functions return one value within a group if you specify the GROUP BY clause in the query and it returns a single value if group by is not specified in the oracle statements.

eg :

select department_id,sum(salary)
from department
group by department_id;

This would return one row for each department id avalable .

another example is

select sum(salary) from department;

This would return just one row and that is the count .

There are several aggregate functions available in oracle .lets glance at them briefly 


No comments:

Post a Comment