Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: sql query build question
It's probably easiest to just do a union query...
select *
from tab
where something = 'Y' and somewhat = 'Y'
union
select *
from tab
where something = 'Y' or somewhat = 'Y'
and not exists (
select *
from tab
where something = 'Y' and somewhat = 'Y'
)
Richard
"Michael L. Hostbaek" wrote:
>
> hey...
>
> I have a question that has been bugging me for quite a while.
>
> I would like to build a query string, that says I want all where
> something = Y and all where somewhat = Y...
>
> Let's say that, no entries in my base has somewhat = Y AND something = Y
> , but I would like to get all the ones where something = Y and all the
> ones where somewhat = Y -but I would like only to issue one query... is
> it possible ?
>
> Any help is MUCH appreciated..
>
> --
> Regards,
> Michael L. Hostbaek
> -= Thanks for all the fish.. =-
Received on Wed Nov 21 2001 - 19:29:33 CST
![]() |
![]() |