Results 1 to 2 of 2
  1. #1
    Join Date
    Jan 2010
    Posts
    64

    Unanswered: aggregate func. sum() - Help

    My query is working fine :-
    select JV.polref, cl012.EMPSTACDE, sum(po030.totprm/12)
    from
    Policies_JV JV ,
    linc _co040 co040,
    linc_cl012 cl012,
    linc _po030 po030
    where
    JV.polref = co040.polref and
    co040.cliref = cl012.cliref and
    JV.polref = po030.polref
    group by JV.polref,cl012.EMPSTACDE;

    It is giving 1000 rows. I am trying to make one change in the above query.
    I want those record where sum(po030.totprm/12) > 300 but i am not able to incorporate this condition.

    Please Advise !!!!!

    Cheers!
    Subhotech

  2. #2
    Join Date
    Aug 2009
    Location
    Olympia, WA
    Posts
    337
    You can either use HAVING or a sub query.

    ...
    GROUP BY jv.polref, cl012.empstacde
    HAVING SUM(po030.toprm/12) > 300

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •