-
-
Save jezinka/0269db5bdc85e36699b974f41f9696af to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select ingredient._id, ingredient.name, | |
CASE WHEN EXISTS( | |
SELECT 1 from ingredient as ingredient2 | |
join meal_ingredient on ingredient2._id= meal_ingredient.ingredient_id | |
join meal on meal._id= meal_ingredient.meal_id | |
where ingredient2._id = ingredient._id and meal._id = ? | |
) THEN 1 | |
ELSE 0 | |
END as checked | |
from ingredient |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment