Closed jyanez04 closed 5 months ago
Completed, this was a nightmare to fix. Solved yesterday.
CREATE VIEW totals AS( SELECT id, count(id) cnt2 FROM ingredients GROUP BY id );
CREATE VIEW numIng AS( SELECT id, count(id) as cnt1 FROM ingredients WHERE ingredient_name IN (' milk', ' vanilla', ' nuts', 'brown sugar', ' butter', ' bite size shredded rice biscuits') GROUP BY id );
SELECT * FROM totals, numIng WHERE totals.id = numIng.id AND cnt1 = cnt2
The product must be able to get the list of ingredients and make an SQL query to gather recipes that ONLY have this list of ingredients.