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 -> newbie: select statement question

newbie: select statement question

From: P. Griffioen <pgriffioen_at_hotmail.com>
Date: Thu, 10 Jul 2003 21:16:13 +0200
Message-ID: <3f0dbb75$0$126$e4fe514c@dreader4.news.xs4all.nl>


Hello,

I am having troubles figuring out how to get the following result with a sql statement:

suppose I have two columns (A and B), populated with the following data :

A B
1 1
1 2
1 3
1 4
2 1
2 2
2 3
3 1
3 2
3 3

Now, I want to get a selection of A and B where the value of B is in all selections of A(1,2,3,4).

In the example above I want a return of all records -except- of the combination 1,4 (because 4 is only present in A(1) and not in the other values of A).

I have tried some subselects and a joining of the same table; but i don't think that is the right approach.

Thank you in advance for any hints.

best regards,
Peter Received on Thu Jul 10 2003 - 14:16:13 CDT

Original text of this message

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