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 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 ) 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 Link to comment https://forums.phpfreaks.com/topic/84143-solved-merge-3-tables/#findComment-428843 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.