Skip to content
Snippets Groups Projects
Commit 9d810808 authored by Olivier Maury's avatar Olivier Maury
Browse files

Renommer `normalvalue.computedvalue` en `normalvalue.median`. refs www#60

parent d108f1ea
No related branches found
No related tags found
No related merge requests found
......@@ -14,11 +14,11 @@ i.id AS "indicator",
s.cell,
s.enddate AS date,
s.rawvalue AS computedvalue,
COALESCE(s.rawvalue - n.computedvalue, 0) AS comparedvalue
COALESCE(s.rawvalue - n."median", 0) AS comparedvalue
FROM %1$s AS s
JOIN agrometinfo."indicator" AS i ON i.code=s."indicator"
JOIN agrometinfo."period" AS p ON p.id=i."period" AND p.phase=s.phase
LEFT JOIN agrometinfo.normalvalue AS n ON n."indicator"=i.id AND n.cell =s.cell AND n.doy = EXTRACT(doy FROM s.enddate)
LEFT JOIN agrometinfo.normalvalue AS n ON n."indicator"=i.id AND n.cell=s.cell AND n.doy = EXTRACT(doy FROM s.enddate)
WHERE s.category ='indicator'
ORDER BY s.enddate, s.cell , i.id
ON CONFLICT ON CONSTRAINT "UK_dailyvalue" DO
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment