Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: SQL statement question
I haven't seen David Fitzjarrell's response here. But I got his email. He corrected me on this. The count(*) in having is for the inner count and it's incorrect to say the query always returns 1.
Yong Huang
yhuang_at_indigopool.com
Yong Huang <yhuang_at_indigopool.com> wrote in message
news:8p8gvn$8r$1_at_news.sinet.slb.com...
> Should be the outer count().
>
> BTW, what's the use of this query? It always returns 1 anyway.
>
> Yong Huang
> yhuang_at_indigopool.com
>
> Jimmy <anonymous_at_anonymous.com> wrote in message
> news:39B87462.9749954A_at_anonymous.com...
> > Hello all,
> >
> >
> > THe following SQL statement:
> >
> > select count(count(*)) from table_a group by field_a having count(*) >
> > 1
> >
> >
> > Is the count(*) in the having part refer to the inner count(*) (or
> > outer count(*)) in the select part? Maybe the answer can be known by
> > testing, however, could anyone explain how Oracle resolve the above
> > query?
> >
> > Thanks,
> > Jimmy
>
>
Received on Thu Sep 07 2000 - 16:53:27 CDT
![]() |
![]() |