Results 1 to 4 of 4

Thread: Aggregate function

  1. #1
    Junior Member
    Join Date
    Apr 2008
    Answers
    1

    Aggregate function

    Hi All,

    Can anyone give me the details in regarding of Aggregate function and their usees in Business applications.

    Thanks
    AShok


  2. #2
    Expert Member
    Join Date
    Apr 2007
    Answers
    500

    Re: Aggregate function

    refer this link


  3. #3
    Junior Member
    Join Date
    Apr 2008
    Answers
    1

    Re: Aggregate function

    aggregate function nothing but group fuction.
    there are max, min, avg,sum, count, stddev, variance


  4. #4
    Expert Member
    Join Date
    Sep 2007
    Answers
    697

    Re: Aggregate function

    >>aggregate function nothing but group fuction.

    No. Both are different.

    Group functions return one result per one group.

    SQL> SELECT JOB, AVG(SAL) FROM EMP
    2 GROUP BY JOB;

    JOB AVG(SAL)
    --------- ---------
    ANALYST 300
    CLERK 103.75
    MANAGER 275.83333
    PRESIDENT 500
    SALESMAN 140

    Using aggregate functions we can display groups results along with individual rows which is not possible using group functions.

    SQL> SELECT ENAME,JOB, AVG(SAL)
    2 OVER (PARTITION BY JOB) AVGSAL
    3 FROM EMP;

    ENAME JOB AVGSAL
    ---------- --------- ---------
    SCOTT ANALYST 300
    FORD ANALYST 300
    SMITH CLERK 103.75
    ADAMS CLERK 103.75
    MILLER CLERK 103.75
    JAMES CLERK 103.75
    JONES MANAGER 275.83333
    CLARK MANAGER 275.83333
    BLAKE MANAGER 275.83333
    KING PRESIDENT 500
    ALLEN SALESMAN 140
    MARTIN SALESMAN 140
    TURNER SALESMAN 140
    WARD SALESMAN 140

    14 rows selected.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact