projects
/
nutratech
/
nt-sqlite.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c0dcf5b
)
functions
author
gamesguru
<mathmuncher11@gmail.com>
Wed, 30 Sep 2020 21:21:24 +0000
(17:21 -0400)
committer
gamesguru
<mathmuncher11@gmail.com>
Wed, 30 Sep 2020 21:21:24 +0000
(17:21 -0400)
sql/functions.sql
patch
|
blob
|
history
diff --git
a/sql/functions.sql
b/sql/functions.sql
index c77d7e3b697ec5cd92b0af66e652026367235644..d47e9ab713a56981c817fa55afb2331d0f77d159 100644
(file)
--- a/
sql/functions.sql
+++ b/
sql/functions.sql
@@
-151,3
+151,20
@@
WHERE
OR tricep.value
OR suprailiac.value;
+--------------------------------
+-- Recipes overview
+--------------------------------
+
+SELECT
+ id,
+ name,
+ COUNT(recipe_id) AS n_foods,
+ SUM(grams) AS grams,
+ guid,
+ created
+FROM
+ recipes
+ LEFT JOIN recipe_dat ON recipe_id = id
+GROUP BY
+ id;
+