-
Ben Gray thinks this is interesting:
SELECT prod_name, vend_name, prod_price, quantity
FROM OrderItems, Products, Vendors
WHERE Products.vend_id = Vendors.vend_id
FROM OrderItems, Products, Vendors
WHERE Products.vend_id = Vendors.vend_id
From
- Lesson 12. Joining Tables
- from Sams Teach Yourself SQL in 10 Minutes, Fourth Edition
- Publisher: Sams
- Released: October 2012
Note
INNER JOIN syntax for this code:
SELECT prod_name, vend_name, prod_price, quantity
FROM OrderItems INNER JOIN Products INNER JOIN Vendors
ON Products.vend_id = Vendors.vend_id AND
OrderItems.prod_id = Products.prod_id
WHERE order_num = 20007;
Minimise