in clause problem

From: <georg_gruber_at_web.de>
Date: 23 Apr 2001 11:18:33 GMT
Message-ID: <9c1329$qgh$1_at_news.netmar.com>


hi, my name is Georg Gruber and this is my first posting to this newsgroup.

i hope i'm right here with my question.

i have the following problem...

there are three tables

C (id, name)
M (id, name)
R (id, ref_c_id, ref_m_id)

Values are:
C


1, C1
2, C2
3, C3

M


1, M1
2, M2
3, M3
4, M4
5, M5

R


1, 1, 1
2, 1, 2
3, 1, 3
4, 2, 2
5, 2, 3
6, 3, 3
7, 3, 4
8, 4, 5

Now i want to select via multiple choise from table M some values and get exactly the name from the according data from table T.

For example:
i want to get all entries from table T when the have M2 AND M3 set in R. result would be: 1, 2 but not 3 because i doesn't have M2.

i tried IN CLAUSE but this won't work right because IN makes a logical OR.

does anybody know a good answer? do i have to build subqueries or temporary tables or something?

thanks for your time and help,

   Georg Gruber.

georg_gruber_at_web.de

  • Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web ----- http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups NewsOne.Net prohibits users from posting spam. If this or other posts made through NewsOne.Net violate posting guidelines, email abuse_at_newsone.net
Received on Mon Apr 23 2001 - 13:18:33 CEST

Original text of this message