Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SELECT
- i.name AS ingredient_name,
- p.name AS product_name,
- d.name AS distributor_name
- FROM ingredients AS i
- JOIN products_ingredients AS pi
- ON i.id = pi.ingredient_id
- JOIN products AS p
- ON p.id = pi.product_id
- JOIN distributors AS d
- ON i.distributor_id = d.id
- WHERE LOWER(i.name) = 'mustard' AND d.country_id = 16
- ORDER BY p.name;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement