Loading

Friday, October 28, 2011

ORACLE SQL TUTORIAL: GROUP FUNCTIONS


GROUP FUNCTIONS

Ø  Sum
Ø  Avg
Ø  Max
Ø  Min
Ø  Count

Group functions will be applied on all the rows but produces single output.

a) SUM

     This will give the sum of the values of the specified column.

     Syntax: sum (column)

     Ex:
          SQL> select sum(sal) from emp;

  SUM(SAL)
   ----------
     38600

b) AVG

     This will give the average of the values of the specified column.

     Syntax: avg (column)

     Ex:
          SQL> select avg(sal) from emp;

   AVG(SAL)
   ---------------
   2757.14286

c) MAX

     This will give the maximum of the values of the specified column.

     Syntax: max (column)

     Ex:
          SQL> select max(sal) from emp;

    MAX(SAL)
   ----------
     5000
        d) MIN

     This will give the minimum of the values of the specified column.

     Syntax: min (column)

     Ex:
          SQL> select min(sal) from emp;

   MIN(SAL)
   ----------
     500
e) COUNT

     This will give the count of the values of the specified column.

     Syntax: count (column)

     Ex:
          SQL> select count(sal),count(*) from emp;





1 Responses to “ORACLE SQL TUTORIAL: GROUP FUNCTIONS”

Sridevi K said...
October 8, 2016 at 1:01 AM

Regards
Sridevi Koduru (Senior Oracle Apps Trainer Oracleappstechnical.com)
LinkedIn profile - https://in.linkedin.com/in/sridevi-koduru-9b876a8b
Please Contact for One to One Online Training on Oracle Apps Technical, Financials, SCM, SQL, PL/SQL, D2K at training@oracleappstechnical.com | +91 - 9581017828.


Post a Comment

Disclaimer

The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.