Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003
    Posts
    8

    Post Unanswered: GROUP BY expression

    SELECT distinct quicklook_id, global_id, to_char(compensation_month,'mm')||'/01/'||to_char(compensation_month,'yy')compMonth,
    element_id, decode(sum(NVL(compensation_amount,0)),'0','', (to_char(sum(NVL(compensation_amount,0)),'99999999 .99'))) as comp,
    associates_last_name, associates_first_name, associates_middle_name, job_code, currency_code, country_code
    FROM sot_order_narcs_vw WHERE country_code ='US' AND compensation_month >= to_date('3/01/2002','mm/dd/yyyy') and
    compensation_month <= last_day(to_date('3/01/2002','mm/dd/yyyy'))
    GROUP BY quicklook_id, global_id,
    to_char(compensation_month,'mm')||'/01/'||to_char(compensation_month,'yy'),
    element_id, associates_last_name,
    associates_first_name, associates_middle_name,
    job_code, currency_code,

    Exception: java.sql.SQLException: ORA-00979: not a GROUP BY expression

  2. #2
    Join Date
    Sep 2002
    Location
    UK
    Posts
    5,171
    Provided Answers: 1

    Re: GROUP BY expression

    It works OK for me, at least whan I add country_code to the GROUP BY!

    BTW: No need for DISTINCT in a GROUP BY query

Posting Permissions

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