Skip to content
Advertisement

Tag: count

Select from multiple tables with group and join

i have 4 tabels drinks, opskrifter, ingredients and stock the tables consist of drinks drink_id name beskriv glas image alcohol opskrifter drink_id ingredient_id quantity ingredients ingredient_id name stock ingredient_id name i want a query to select drinks that can be made in opskrifter of the ingredients in stock. i have this working, but it only returns drink_id. I want it

Return only recipes that contains all ingredients Sql

I have these 3 tables: Drinks drink_id name Ingredients ingredient_id name Opskrifter drink_id ingredient_id quantity Drinks and Ingredients are cross-referenced in opskrifter. I want to return all recipes from opskrifter that have ingredients from another table called Stock name So to make a gin and tonic, I need to have both gin and tonic in stock. If I only have

Advertisement