hi ,
(SELECT 'AR' mod,
rc.CUSTOMER_NAME customer_name,
rct.interface_header_attribute1 ar_won,
sum(rctl.EXTENDED_AMOUNT) Revenue,
gcc.segment2,
rct.trx_number
FROM apps.ra_customer_trx_lines_all rctl,
apps.RA_CUST_TRX_LINE_GL_DIST_ALL rctg,
apps.ra_customer_trx_all rct,
apps.ra_customers rc,
apps.RA_CUST_TRX_TYPES_ALL rctt,
apps.gl_code_combinations gcc
WHERE
rctl.customer_trx_id = rct.customer_trx_id
and rct.BILL_TO_CUSTOMER_ID=rc.CUSTOMER_ID
and rct.CUSTOMER_TRX_ID=rctg.CUSTOMER_TRX_ID
and rctl.CUSTOMER_TRX_LINE_ID=rctg.CUSTOMER_TRX_LINE_ID
and rctg.CUSTOMER_TRX_ID=rct.CUSTOMER_TRX_ID
and rctt.CUST_TRX_TYPE_ID = rct.CUST_TRX_TYPE_ID
and gcc.CODE_COMBINATION_ID=rctg.CODE_COMBINATION_ID
and rctt.TYPE='INV'
and gcc.SEGMENT3 like '5%'
and rctg.ACCOUNT_CLASS='REV'
and rctl.line_type = 'LINE'
and rctg.gl_date between :from_dt and :p_to_dt
and rct.ORG_ID=92
group by rct.interface_header_attribute1,gcc.segment2,rctl.EXTENDED_AMOUNT,rc.CUSTOMER_NAME, rct.trx_number)
in this query my requirement is based on rct.interface_header_attribute1 the amount should be sum and displayed as total amount
For example, if the value of rct.interface_header_attribute1 is 65 then records of amount should be sum and display as the total amount
Thanks,