The following lines contain the word 'select', 'insert', 'update' or 'delete':
SELECT DECODE(greatest(RANKING,10),10,EMC_ACCOUNT,:l_other_account) BIX_EMC_ACCOUNT,
NVL(SUM(CURR_RCVD),0) BIX_EMC_RCVD,
NVL(SUM(CURR_REPLD),0) BIX_EMC_REPLD
FROM (
SELECT account.value EMC_ACCOUNT,
sum(EMAILS_OFFERED_IN_PERIOD) CURR_RCVD,
NVL(sum(EMAILS_REPLIED_IN_PERIOD),0) + NVL(SUM(EMAILS_AUTO_REPLIED_IN_PERIOD),0) CURR_REPLD,
RANK() OVER (ORDER BY nvl(sum(EMAILS_OFFERED_IN_PERIOD),0) DESC,
account.value
) RANKING
FROM bix_email_details_mv fact,
fii_time_rpt_struct cal,
bix_email_accounts_v account
WHERE fact.time_id = cal.time_id
AND fact.row_type = :l_row_type
AND fact.period_type_id = cal.period_type_id
AND cal.report_date = &BIS_CURRENT_ASOF_DATE
AND bitand(cal.record_type_id,&BIS_NESTED_PATTERN)=cal.record_type_id
AND fact.email_account_id = account.id ';