* Rich Allen > if i have the following mySQL tables > > create table list ( > id int, > name char(20) > ); > insert into list values(1, 'bob'); > insert into list values(2, 'joe'); > > create table list2 ( > id1 int, > id2 int > ); > insert into list2 values(1,2); > insert into list2 values(2,1); > > what query will return the following result > > result: > --------- > bob, joe > joe, bob
SELECT l1.name,l2.name FROM list2 LEFT JOIN list l1 ON l1.id=list2.id1 LEFT JOIN list l2 ON l2.id=list2.id2; -- Roger sql --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php