आपको JOIN
. करना होगा टेबल, इस तरह:
SELECT products.description, orders.quantity, orders.price
FROM detail_orders
INNER JOIN products ON (products.prod_id = detail_orders.prod_id)
INNER JOIN orders ON (orders.id = detail_orders.or_id)
यदि आप किसी विशिष्ट उपयोगकर्ता के लिए क्वेरी करना चाहते हैं:
SELECT products.description, orders.quantity, orders.price
FROM detail_orders
INNER JOIN products ON (products.prod_id = detail_orders.prod_id)
INNER JOIN orders ON (orders.id = detail_orders.or_id)
WHERE orders.iduser = someUser