-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmy bill.sql
33 lines (28 loc) · 1.21 KB
/
my bill.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
--version 1.00:
--============
select --sum (rated_flat_amount) bill_value
/*duration_volume, */data_volume ,START_TIME_TIMESTAMP, /*entry_date_timestamp ,*/ o_p_number_address , rated_flat_amount, remark
from rtx , customer_all
where rtx.cust_info_customer_id = customer_all.customer_id
and customer_id = (select ca.customer_id from
directory_number dn , contr_services_cap csc , contract_all co , customer_all ca
where dn.dn_id = csc.dn_id
and csc.co_id = co.co_id
and co.customer_id = ca.customer_id
and dn.dn_num = '123652809'
and csc.cs_deactiv_date is null)
--and rtx.s_p_number_address = '20121004446'
and rtx.START_TIME_TIMESTAMP >= to_date ('01/06/2009' , 'dd/mm/yyyy')
and rtx.START_TIME_TIMESTAMP < to_date ('08/03/2010' , 'dd/mm/yyyy')
--and o_p_number_address not like '202%'
--and length(o_p_number_address) > 6
--and rated_flat_amount <> 0
--and o_p_number_address = '20235720132'
order by START_TIME_TIMESTAMP
select s_p_number_address, duration_volume, entry_date_timestamp,
o_p_number_address , rated_flat_amount,
(rated_flat_amount*100/data_volume) factor from rtx
where o_p_number_address = 'mobinilwap'
and rated_flat_amount<>0
and data_volume>(99*1024)
and rownum<100