I am getting error as column rx.postive does not exist in below query.Kindly help.

  • I am getting error as column rx.postive does not exist in below query.Kindly help.
    select account_id,product_id,sum(rx.postive),sum(rx.negative)
    from(select
    account_id,product_id,
    case when rx_formula in ('approved','unrestricted') then '1' else'0' end as positive,
    case when rx_formula not in ('approved','unrestricted') then '1' else'0' end as negative
    from status)rx
    group by 1,2

    Saravanan

  • saravanatn - Saturday, January 28, 2017 12:44 AM

    I am getting error as column rx.postive does not exist in below query.Kindly help.
    select account_id,product_id,sum(rx.postive),sum(rx.negative)
    from(select
    account_id,product_id,
    case when rx_formula in ('approved','unrestricted') then '1' else'0' end as positive,
    case when rx_formula not in ('approved','unrestricted') then '1' else'0' end as negative
    from status)rx
    group by 1,2

    Can you post the DDL (create table) script for the [status] table please?
    😎

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply