From 8b4bf47e4ce9637631fcd45058381f3a8280f9cb Mon Sep 17 00:00:00 2001 From: Wolfgang Hottgenroth Date: Mon, 4 Dec 2017 21:27:09 +0100 Subject: [PATCH] view schema added --- Schema/view.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 Schema/view.sql diff --git a/Schema/view.sql b/Schema/view.sql new file mode 100644 index 0000000..af583d6 --- /dev/null +++ b/Schema/view.sql @@ -0,0 +1,13 @@ +create or replace view grafana_v as + select concat(di.description, '-', de.description) as description, + da.ts as ts, + da.value * di.multiplicator as value, + de.description as device + from device_t de, + dataitem_t di, + devicedataitem_t ddi, + collecteddata_t da + where de.id = ddi.device and + di.id = ddi.dataitem and + da.devicedataitem = ddi.id; +