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

Home -> Community -> Usenet -> c.d.o.server -> Re: A query without a sub-query: can we do it?

Re: A query without a sub-query: can we do it?

From: Greg Stark <greg-spare-1_at_mit.edu>
Date: Fri, 24 Nov 2000 04:27:11 GMT
Message-ID: <87r942f0z6.fsf@HSE-MTL-ppp66894.qc.sympatico.ca>

David Fitzjarrell <oratune_at_aol.com> writes:

> This sounds like homework to me

To me as well.

>
> select lab_id
> from lab
> where user_id = 2
> minus
> select lab_id
> from lab
> where user_id = 9
>
> No formal subquery there.

In which case you can console your guilt by the fact that I suspect the teacher will consider this an incorrect answer. It's oracle specific and it sounded like his question was coming from a theoretic angle and the teacher probably expects a standard SQL response.

Indeed there is a way to do this in standard SQL without a subquery. You might want to read up on outer joins.

-- 
greg
Received on Thu Nov 23 2000 - 22:27:11 CST

Original text of this message

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