Michael Satterwhite said: > On Monday 19 January 2004 15:38, Jochem van Dieten wrote: >> So let's make it 2 fields: >> >> SELECT >> t1.* >> FROM >> table1 t1, >> table2 t2 INNER JOIN table2 t3 >> ON (t2.rdid = t3.rdid AND t2.vid = 46 AND t3.vid = 554) >> WHERE >> t1.rdid = t2.rdid >> >> Add GROUP BY/DISTINCT per your requirements. > > Although you're giving Table2 two aliases (t2 and t3) there is still > only two tables and *ONE* field. In the join listed above, you are > asking for the records where t2.rdid = t3.rdid (*NOT* what you want > to do, you have now left t1 out of the join altogether) plus ??? > (I'm not sure what this would match, although it looks > interesting).
Why not hold of judgement until you are sure what it would match? > If you absolutely need to do it with a join you might try > > Select t1.* from Table1 t1 JOIN Table2 t2 > on (t1.id = t2.rdid and (t2.vid = 46 or t2.vid = 554)) > > I don't think this is as clear as a simple join with a Where, but > there are a lot of ways to get the same result. Build the tables, run the queries, compare the results. There are even more ways to get a different result, and yours is one of them. Jochem -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]