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

From: A. Fischer <afischer_at_ea.com>
Date: 1996/08/07
Message-ID: <3208FB48.2E87_at_ea.com>#1/1


Bill Schoonmaker wrote:
>
> Fernando Borcel 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
>
> You need to qualify each colunm and table... use this method
>
> SELECT COUNT(A.ANYCOLUMN)/COUNT(B.ANYCOLUMN)
> FROM TABLE1 A, TABLE2 B
And if you do the above with no join between A and B, don't "count" on your results being correct :) Received on Wed Aug 07 1996 - 00:00:00 CEST

Original text of this message