Home » SQL & PL/SQL » SQL & PL/SQL » Pl/SQL Query
Pl/SQL Query [message #243548] Thu, 07 June 2007 13:10 Go to next message
porafaq
Messages: 2
Registered: June 2007
Junior Member
Hi ,
I have the following 2 queries, and i need to combine both to get sum(cing_oct), sum(rad_oct), oct_dt as out put with all the conditions below gourp by date. I'm looking something like query 1 full outer join query 2. Any help is greatly appreciatd.


1.)

select sum(cing_oct), oct_dt
from
(
select round(sum(ACCT_INPUT_OCTETS )/1024)*1024 cing_oct, GPP_IMSI,
TO_DATE(TO_CHAR(ACCT_START_TIME, 'DD-MON-YYYY'),'DD-MON-YYYY HH:MI:SS') oct_dt
from AERBILL_TRAFFIC.CINGULAR_ACCOUNTING
--where ACCT_START_TIME > sysdate -10
group by GPP_IMSI , TO_DATE(TO_CHAR(ACCT_START_TIME,
'DD-MON-YYYY'),'DD-MON-YYYY HH:MI:SS')
order by TO_DATE(TO_CHAR(ACCT_START_TIME,
'DD-MON-YYYY'),'DD-MON-YYYY HH:MI:SS')) a
group by oct_dt
order by oct_dt


2.)

select sum(rad_oct), rad_dt
from
(
select round(sum(ACCT_INPUT_OCTETS )/1024)*1024 rad_oct,round(sum(ACCT_INPUT_OCTETS )) s1, USER_NAME,
TO_DATE(TO_CHAR(ACCT_START_TIME, 'DD-MON-YYYY'),'DD-MON-YYYY HH:MI:SS') rad_dt
from AERBILL_TRAFFIC.RADIUS_ACCOUNTING
--where ACCT_START_TIME > sysdate -10
group by USER_NAME , TO_DATE(TO_CHAR(ACCT_START_TIME,
'DD-MON-YYYY'),'DD-MON-YYYY HH:MI:SS')
order by TO_DATE(TO_CHAR(ACCT_START_TIME,
'DD-MON-YYYY'),'DD-MON-YYYY HH:MI:SS')) b
group by rad_dt
order by rad_dt



Thanx
Re: Pl/SQL Query [message #243562 is a reply to message #243548] Thu, 07 June 2007 14:03 Go to previous message
Michel Cadot
Messages: 64153
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Don't multipost.
See the answers in the other place you posted.
This one is closed.
./fa/448/0/

Regards
Michel
Previous Topic: PL/SQL query
Next Topic: split partition table
Goto Forum:
  


Current Time: Sun Dec 11 04:20:47 CST 2016

Total time taken to generate the page: 0.09202 seconds