arunpatal Posted December 5, 2013 Share Posted December 5, 2013 Hi, I have 2 tables category (cat_id, cat_name) AND subcategory(sub_cat_id, sub_cat_name, category_id) I am tring to run a simple full join statement. <?php require("connect/connection.php"); $sql = mysql_query(" SELECT * FROM $category FULL JOIN $subcategory ON $category.cat_id = $subcategory.category_id ") or die(mysql_error()); ?> And i get a error Unknown column 'category.cat_id' in 'on clause' Quote Link to comment https://forums.phpfreaks.com/topic/284548-full-join/ Share on other sites More sharing options...
jazzman1 Posted December 5, 2013 Share Posted December 5, 2013 (edited) As far as I know, MySQL doesn't support a full outer join only left and right joins. Edited December 5, 2013 by jazzman1 Quote Link to comment https://forums.phpfreaks.com/topic/284548-full-join/#findComment-1461343 Share on other sites More sharing options...
Solution arunpatal Posted December 5, 2013 Author Solution Share Posted December 5, 2013 As far as I know, MySQL doesn't support a full outer join only left and right joins. Yes, you are right Quote Link to comment https://forums.phpfreaks.com/topic/284548-full-join/#findComment-1461345 Share on other sites More sharing options...
Barand Posted December 5, 2013 Share Posted December 5, 2013 I believe you can simulate a FULL join with a union of two LEFT joins Quote Link to comment https://forums.phpfreaks.com/topic/284548-full-join/#findComment-1461397 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.