mrherman Posted September 23, 2008 Share Posted September 23, 2008 Hi, I discovered to my chagrin that MySQL does not do FULL OUTER JOINs. At any rate, after much researching, I have ended up with the code below, in which each of the queries works separately, but when I try to join them with the UNION clause, I receive an error saying that "can't reopen temp2". These are all are temporary tables -- Does that make a difference? SELECT temp1.last_name FROM temp1 LEFT OUTER JOIN temp2 ON temp1.student_id = temp2.student_id UNION SELECT temp2.last_name FROM temp2 LEFT OUTER JOIN temp1 ON temp2.student_id = temp1.student_id ; I've tried parentheses, etc., but nothing has worked yet. Thanks for any advice! Quote Link to comment Share on other sites More sharing options...
Barand Posted September 23, 2008 Share Posted September 23, 2008 With that query you may as well just do SELECT temp1.last_name FROM temp1 UNION SELECT temp2.last_name FROM temp2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.