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: Can I do this strictly in SQL*Plus?

Re: Can I do this strictly in SQL*Plus?

From: Akp <abhishek1999_at_gmail.com>
Date: 7 Jun 2005 06:02:46 -0700
Message-ID: <1118149366.384113.174750@g14g2000cwa.googlegroups.com>


You can use inline view for this



select count(*) row_count from table1
UNION
select count(*) row_count from table2
UNION
select sum(row_count) row_count from
(
  select count(*) row_count from table1
  UNION
  select count(*) row_count from table2
)

RK wrote:
> Can someone help me, please? -- I want to do the following steps, and
> output strictly in SQL*Plus only:
>
> -1- select count(*) from table1;
> -2- select count(*) from table2;
>
> Assume the results are r1 and r2, two numbers, and I want the output to
> be like:
>
> Total: r1 + r2
> Count1: r1
> Count2: r2
>
> Can I do this strictly in SQL*Plus?
>
> Thanks.
Received on Tue Jun 07 2005 - 08:02:46 CDT

Original text of this message

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