Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Sum(amount)

GAug 5 2010 — edited Aug 6 2010
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,
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 3 2010
Added on Aug 5 2010
18 comments
2,629 views