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 -> Re: 2 select(count(*)) in a query

Re: 2 select(count(*)) in a query

From: Steve <alan_bo_at_hotmail.com>
Date: 21 Sep 2001 06:47:29 -0700
Message-ID: <15c65e2b.0109210547.797b4872@posting.google.com>


IB <Ismael.BALLO_at_NOSPAMcern.ch> wrote in message news:<3BAB1401.EFC34354_at_NOSPAMcern.ch>...
> Hi,
>
> I've got 2 tables and I ask to myself if we can count total elements of
> the 2 tables in one query
>
> Ex : select count(*) from A + select count(*) from B.
> 'This' is not possible but is there a way ?
>
> Thanks in advance.

Do one thing:

select (a.c1 + b.c2) total from
(select count(*) c1 from table1) a, (select count(*) c2 from table2) b;

That is one of the way to do that.

Thanks Received on Fri Sep 21 2001 - 08:47:29 CDT

Original text of this message

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