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' 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 As far as I know, MySQL doesn't support a full outer join only left and right joins. Link to comment https://forums.phpfreaks.com/topic/284548-full-join/#findComment-1461343 Share on other sites More sharing options...
arunpatal Posted December 5, 2013 Author 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 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 Link to comment https://forums.phpfreaks.com/topic/284548-full-join/#findComment-1461397 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.