forecast_api/tots.sql
2020-04-07 14:28:32 -04:00

17 lines
495 B
SQL

SELECT
oseas,
to_char(CASE WHEN extract(month FROM o.odate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.odate),'FM00')||' - '||to_char(o.odate,'TMMon') order_month,
version,
iter,
sum(fb_val_loc) value_loc
FROM
rlarp.osmfs_dev o
GROUP BY
oseas,
to_char(CASE WHEN extract(month FROM o.odate) >= 6 THEN -5 ELSE 7 END + extract(month FROM o.odate),'FM00')||' - '||to_char(o.odate,'TMMon'),
version,
iter
ORDER BY
oseas asc,
order_month asc