ayok Posted January 2, 2008 Share Posted January 2, 2008 Hi, I have 3 tables: 1. order_list(order_id,prod_id,quantity) 2. buyer(order_id,buyer_name) 3. products(prod_id,prod_name) I want to make a table with which contain those datas: buyer_name, prod_name, and quantity What should be the mysql query for this? Thank you, ayok Quote Link to comment https://forums.phpfreaks.com/topic/84143-solved-merge-3-tables/ Share on other sites More sharing options...
fenway Posted January 2, 2008 Share Posted January 2, 2008 SELECT b.buyer_name, p.prod_name, ol.quantity FROM order_list AS ol JOIN buyer AS b ON ( b.order_id = ol.order_id ) JOIN products AS p ON ( p.prod_id = ol.prod_id ) Quote Link to comment https://forums.phpfreaks.com/topic/84143-solved-merge-3-tables/#findComment-428391 Share on other sites More sharing options...
ayok Posted January 3, 2008 Author Share Posted January 3, 2008 Super!! Thanks fenway, ayok Quote Link to comment https://forums.phpfreaks.com/topic/84143-solved-merge-3-tables/#findComment-428843 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.