RelationalDesign: dml_nutritioneer_calculations_0.1.sql
| File dml_nutritioneer_calculations_0.1.sql, 301 bytes (added by , 2 weeks ago) |
|---|
| Line | |
|---|---|
| 1 | |
| 2 | UPDATE recipe |
| 3 | SET kcal_sum = ( |
| 4 | SELECT SUM(ingredient.kcal * recipe_contains_ingredient.ingredient_quantity / 100) |
| 5 | FROM recipe_contains_ingredient, ingredient |
| 6 | WHERE recipe_contains_ingredient.ingredient_name = ingredient.name |
| 7 | AND recipe_contains_ingredient.recipe_id = recipe.id |
| 8 | ); |
| 9 |
