The following code gives me this error
ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended" *Cause:
*Action: Error at Line: 26 Column: 1
for i in (7,14,21,28,35)
loop
Select CODE_ACCOUNTING_METHOD,
trunc(sysdate-i, 'iw') as week_report,
sum(ELI_12MOB) as eligible_client,
sum(client) as total_client,
(sum(ELI_12MOB)/sum(client))*100 as eligible_rate
from pm_eli_base
where week_start = trunc(sysdate-(360+i), 'iw')
and code_accounting_method != 'CL'
group by CODE_ACCOUNTING_METHOD, trunc(sysdate-i, 'iw')
union all
select 'Total',
trunc(sysdate-i, 'iw') as week_report,
sum(ELI_12MOB) as eligible_client,
sum(client) as total_client,
(sum(ELI_12MOB)/sum(client))*100
from pm_eli_base
where week_start = trunc(sysdate-(360+i), 'iw')
and code_accounting_method != 'CL'
group by 'Total', trunc(sysdate-i, 'iw')
end loop;
Please help me with this case