Re: Dividing two Count(*)'s ??

From: Thomas J. Kyte <tkyte_at_us.oracle.com>
Date: 1996/08/02
Message-ID: <3201548b.1864000_at_dcsun4>#1/1


On Thu, 01 Aug 1996 01:01:53 -0300, Fernando Borcel <fb_at_overnet.com.ar> wrote:

>How do I perform a query that returns the division between the count of two tables?
>
>That is to say:
>
> Select count(*) / (Select count(*) from Tb2) from Tb2;
>
>Thanks!
>
>Fernando Borcel
>
>

In 7.1 and up:

select cnt1/cnt2
from ( select count(*) cnt1 from tb1 ),

     ( select count(*) cnt2 from tb2 )
/

or

select count(*)/cnt2
from tb1, ( select count(*) cnt2 from tb2 ) /

Thomas Kyte
Oracle Government
tkyte_at_us.oracle.com                          

http://govt.us.oracle.com -- Check out our web site! Brand new, uses Oracle Web Server and Database


statements and opinions are mine and do not necessarily reflect the opinions of Oracle Corporation Received on Fri Aug 02 1996 - 00:00:00 CEST

Original text of this message