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