Let me post the question this way,

MyTable
-------------------------------
pointerid     valueid
811                     54
811                     63
812                     100
813                     200
814                     300
815                     400

I want all the records in MyTable where (valueid=54 and valueid=63) or valueid=400 group by pointerid
Which means I would get the records whose pointer id is 811 and 815


Thanks,
Joe


On Monday, January 19, 2004, at 03:03 PM, Jamie Murray wrote:


Joe didn't you already post this question last week and have it correctly
answered by Roger ?
I only ask because at that time I saw the query and thought to myself that
the left outer join solution posted by Roger
would not give you the results you had expected.



----- Original Message ----- From: "sulewski" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, January 19, 2004 3:47 PM Subject: SQL Query Question


Okay, I think I'm missing something obvious. I have two tables

Table 1                               Table 2
___________                   _____________
ID                                         rdid  vid
___________                   _____________


ID in table 1 links to rdid in table 2. This is a one to many relationship. Now I wish to find all the items in table 1 where table2.rdid= table1.rdid and (table2.vid=46) and (table2.vid=554)

In other words which records from table 1 link to two records in table
2 who's vid are 46 and 554.

I hope this makes sense.

Thanks
Joe


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:
http://lists.mysql.com/[EMAIL PROTECTED]




--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to