SELECT table1.id FROM table1, table2, table3 WHERE table1.cl1 = 1 AND table1.cle2=5 AND table1.cl3 IN(1,2,5,8) AND table2.cl1 = 4 AND table2.cle2 IN (10,12,81) AND table2.cl3 IN (3,7) AND table3.distance BETWEEN 1 AND 99 AND table1.id = table2.id AND table2.id = table3.id;
That should do what you are looking for, otherwise let us know. Regards, Mike Hilyer www.vbmysql.com -----Original Message----- From: Anthony Ward [mailto:[EMAIL PROTECTED] Sent: Thursday, June 05, 2003 12:17 PM To: [EMAIL PROTECTED] Subject: Join question Hi, I have posted a similar question, but can't find the answers. I'm sorry. What i'm trying to do is that i have 3 tables each has three columns and are indexed. so I want to do something like select everything in 3 tables and display only similar id. Select id from table1 where table1.cl1 = 1 and table1.cle2=5 and table1.cl3 IN(1,2,5,8) Join Select id from table2 where table2.cl1 = 4 and table2.cle2IN(10,12,81) and table2.cl3 IN(3,7) Join Select id from table3 where table3.distance BETWEEN 1 and 99 where table1.id = table2.id=table3.id Any help is appreciated Anthony -- 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]