Page 1 of 1

Counts of records in Different tables

Posted: Mon Nov 27, 2006 9:41 am
by azeezpasha
Hi Friends,

i was assigned a task to develop the report in property manager reports, in my task there is a requirement like follows:
total sum of amount from rctlgda, count of total records from 2 tables i have developed the below query but it is not working.

select
(select sum(amount) from rctlgda) Tot_Amt,
(select count(*) from rctlgda) Tot_cnt,
(select count(*) from rcta) Suc_cnt
from
ra_cust_trx_line_gl_dist_all rctlgda,
ra_customer_trx_all rcta
where rctlgda.request_id = rcta.request_id --> Mapping between 2 table

can any body please help to solve this problem its very very urgent.

we are not able to map the tables with request_id bcos its showing many records. is there a way where we can get the exact sum(amount) and count(*) from the abv tables??

awaiting for your early reply.

Regards,
Azeez

Posted: Tue Nov 28, 2006 1:09 am
by ahmadbilal
select
(select sum(amount) from ra_cust_trx_line_gl_dist_all) Tot_Amt,
(select count(*) from ra_cust_trx_line_gl_dist_all) Tot_cnt,
(select count(*) from ra_customer_trx_all) Suc_cnt
from
ra_cust_trx_line_gl_dist_all rctlgda,
ra_customer_trx_all rcta
where rctlgda.request_id = rcta.request_id





select unique
(select sum(amount) from ra_cust_trx_line_gl_dist_all) Tot_Amt,
(select count(*) from ra_cust_trx_line_gl_dist_all) Tot_cnt,
(select count(*) from ra_customer_trx_all) Suc_cnt
from
ra_cust_trx_line_gl_dist_all rctlgda,
ra_customer_trx_all rcta
where rctlgda.request_id = rcta.request_id