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: help queries

Re: help queries

From: Marc <langkamp_at_mailcity.com>
Date: Tue, 18 Sep 2001 11:35:26 +0200
Message-ID: <3ba71553$1@gaspra.oss.akzonobel.nl>


There might be more sophisticated solutions but I think this one might work

hth, marc

Select alias1.car,alias1.optional, alias2.optional from table alias1, table alias2
where alias1.car = alias2.car
and alias1.optional = 1
and alias2.optional = 5

Select alias1.car,alias1.optional, alias2.optional from table alias1, table alias2
where alias1.car = alias2.car
and alias1.optional = 1
and alias2.optional = 5
and not exists (select 1 from table alias3

                        where alias1.car = alias3.car
                         and alias3.optional = 3)



"Virgilio Gambarotto" <gambarotto_at_greensoft.it> wrote in message news:2Qip7.47952$F45.492136_at_news1.tin.it...
> Hi
> I have a table like this:
> car optional
> ford 1
> ford 2
> ford 5
> gm 3
> gm 1
> gm 5
> ferrari 1
> ferrari 7
> Q1
> I need to retrieve only cars having optioinals 1 and 5
> result must be
> ford 1 5
> gm 1 5
>
> Q2
> I need to retrieve only cars having optioinals 1 and 5 and not 3
> result must be
> ford 1 5
>
> Tia
> i_mac
>
>
Received on Tue Sep 18 2001 - 04:35:26 CDT

Original text of this message

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