Re: SQL Question
Posted in 2000
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Server Administration
tomek@ampr.gliwice.pl wrote:
>I want two counts in one statement with two different where filters!!!
>
>Maybe it looks alike this:
>
>SELECT a.count(*), b.count(*) from TabA a, TabA b where
>a.ColA=X and b.ColB=Y
>
>but.. this is not the right one.
In earlier posts both X and Y were located in ColA, there was no ColB. Have things changed or is that a typo? Are you doing this in 4gl, dbaccess, from the command line? There are different ways to handle things depending on what it is you are trying to accomplish. Sounds like you're getting frustrated, so perhaps with more info we'd know how to accomplish what you want.
carlos
Currently on hiatus from unemployment.
----------------------
Do you do Linux? :)
Get your FREE @linuxstart.com email address at: http://www.linuxstart.com
> tomek@ampr.gliwice.pl wrote:
>
> >I want two counts in one statement with two different where filters!!!
> >
> >Maybe it looks alike this:
> >
> >SELECT a.count(*), b.count(*) from TabA a, TabA b where
> >a.ColA=X and b.ColB=Y
> >
> >but.. this is not the right one.
>
> In earlier posts both X and Y were located in ColA, there was no ColB.
Have things changed or is that a typo? Are you doing this in 4gl, dbaccess,
from the command line? There are different ways to handle things depending
on what it is you are trying to accomplish. Sounds like you're getting
frustrated, so perhaps with more info we'd know how to accomplish what you
want.
>
> carlos
It was only a typo (ColA=X and ColA=Y). I have to put one single select
statement into special reporting system which is out of my control. So every
solutions based on temp tables, stored procedures etc are good but not very
good :((
Read my new post where I wrote rest of my problem.
Tom