Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Case Statement with multiple "AND" conditions

spalato76Mar 16 2016 — edited Mar 16 2016

Hi All,

I'm currently using Oracle version 10g. I get an ORA-00979: not a GROUP BY expression and it highlights the Fiscal Year End column.

  (CASE WHEN (FISCAL_YEAR_END = 2003 AND ACTIVE_COVERAGE = '1') and (FISCAL_YEAR_END = 2002 AND ACTIVE_COVERAGE = '1') THEN '1'

        WHEN (FISCAL_YEAR_END = 2003 AND ACTIVE_COVERAGE = '0') and (FISCAL_YEAR_END = 2002 AND ACTIVE_COVERAGE = '0') THEN '0'

        WHEN (FISCAL_YEAR_END = 2003 AND ACTIVE_COVERAGE = '1') and (FISCAL_YEAR_END = 2002 AND ACTIVE_COVERAGE = '0') THEN '1'

        WHEN (FISCAL_YEAR_END = 2003 AND ACTIVE_COVERAGE = '0') and (FISCAL_YEAR_END = 2002 AND ACTIVE_COVERAGE = '1') THEN '2'

       ELSE null END) AS HCN_VALID_2002_INDICATOR

Thanks,

Edward

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 13 2016
Added on Mar 16 2016
16 comments
2,876 views