News Alert: Experts Exchange Confirmed as Safe in Cloudbleed Leak Read More
SELECT fc.rep_period_start_dt start_date,
fc.rep_period_end_dt end_date,
fc.benefit_compliance_group benefit_compliance_group,
SUM (fc.total_amount) amount,
(CASE
WHEN SUM ( (SUM (fc.total_amount))) = 0
THEN
0
ELSE
(SUM (fc.total_amount))
/ SUM ( (SUM (fc.total_amount))) OVER ()
END)
TOT_PERCENT
FROM saas.fact_compliance fc
WHERE fc.transaction_group_code = 'SALE' AND fc.benefit_status = 'A'
AND fc.benefit_compliance_group IN
('GRO',
'EAB',
'GMWB',
'IAB',
'LT5',
'GMDB',
'GMIB',
'HDV',
'HD',
'HDGRO')
AND fc.transaction_count > 25
AND (fc.contract_issue_date BETWEEN (SELECT REP_PERIOD_START_DT
FROM SAAS.FACT_COMPLIANCE
WHERE REP_PERIOD_START_DT IS NOT NULL
AND ROWNUM = 1)
AND (SELECT REP_PERIOD_end_DT
FROM SAAS.FACT_COMPLIANCE
WHERE REP_PERIOD_END_DT IS NOT NULL
AND ROWNUM = 1))
GROUP BY fc.rep_period_start_dt,
fc.rep_period_end_dt,
fc.benefit_compliance_group,
(CASE
WHEN SUM ( (SUM (fc.total_amount))) = 0
THEN
0
ELSE
(SUM (fc.total_amount))
/ SUM ( (SUM (fc.total_amount))) OVER ()
END);
A SELECT list cannot include both a group function, such as AVG, COUNT, MAX, MIN, SUM, STDDEV, or VARIANCE, and an individual column expression, unless the individual column expression is included in a GROUP BY clause.
If you are experiencing a similar issue, please ask a related question
Title | # Comments | Views | Activity |
---|---|---|---|
Getting a return value from an IN OUT parameter in Oracle? | 7 | 54 | |
'G_F01' is not a procedure or is undefined | 3 | 25 | |
ORA-00923: FROM keyword not found where expected | 3 | 64 | |
Help on model clause | 5 | 32 |
Join the community of 500,000 technology professionals and ask your questions.