Home » SQL & PL/SQL » SQL & PL/SQL » PL/SQL query
PL/SQL query [message #243543] Thu, 07 June 2007 12:57 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
Pari
Re: PL/SQL query [message #243545 is a reply to message #243543] Thu, 07 June 2007 13:01 Go to previous message
BlackSwan
Messages: 25050
Registered: January 2009
Location: SoCal
Senior Member
Reading & FOLLOWING posting guidelines in the STICKY posts at the top of this forum will improve the odds your question will get answered.

Do NOT cross/multi-post!
http://www.orafaq.com/forum/t/83202/74940/

[Updated on: Thu, 07 June 2007 13:17] by Moderator

Report message to a moderator

Previous Topic: Many sql statements are not working in SQL Server 2000.Plz Help?
Next Topic: Pl/SQL Query
Goto Forum:
  


Current Time: Sun Dec 11 04:29:19 CST 2016

Total time taken to generate the page: 0.07948 seconds