Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> 2 queries with one select :is it possible???

2 queries with one select :is it possible???

From: gil guerillot <gil.guerillot_at_ratp.fr>
Date: Wed, 12 Sep 2001 16:49:32 +0100
Message-ID: <9nnsfo$3va$1@gotix.reseau.ratp>


i have 2 select queries with different 'where and group by clauses'  i'd like only one select to obtain something like that: select evt_code,to_char(EVT_COMPLETED,'mm'),C1,C2.....

Q1
select evt_code,to_char(EVT_COMPLETED,'mm'),count(*) C1 from T1
where EVT_COMPLETED between :begindate_param and :enddate_param and status='C'
group by EVT_code, to_char(EVT_COMPLETED,'mm')

Q2
select evt_code,to_char(EVT_target,'mm'),count(*) C2 from T1
where EVT_target < :begindate_param
and status='A'
group by EVT_code, to_char(EVT_target,'mm')

is it possible with SQL? Received on Wed Sep 12 2001 - 10:49:32 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US