Re: SQL Question
Posted in 2000
Try this,
select count(*) as countX, (select count(*) from TabA where ColA=Y) ascountY
from TabA where ColA=X;
julia
Tom wrote:
> Statement have to return 1 row!! (with two columns)
>
> "gignez P." <gignez.pascal@siemens.be> wrote in message
> news:8hicui$dn5$1@news.mch.sbs.de...
> > If you want the grand total, just use
> >
> > select count(*) form TabA where ColA in(X, Y);> >
> > if you want each subtotal
> >
> > select count(*) form TabA where ColA in(X, Y)
> > group by ColA;> >
> > this last one returns 2 rows.
> >
> > Tomasz Baron <tomasz_baron@banpol.pl> a 'crit dans le message :
> > Hm2%4.3380$qi.88060@news.tpnet.pl...
> > > How to combine into a single question something like this:
> > >
> > > select count(*) from TabA where ColA=X;
> > > select count(*) from TabA where ColA=Y;> > >
> > >
> > >
> > > Thanks for all answers
> > >
> > >
> > >
> >
> >