Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: sql query build question

Re: sql query build question

From: Richard Kuhler <noone_at_nowhere.com>
Date: Thu, 22 Nov 2001 01:29:33 GMT
Message-ID: <1yYK7.42079$D5.18572122@typhoon.san.rr.com>


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

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US