view schema added

This commit is contained in:
Wolfgang Hottgenroth 2017-12-04 21:27:09 +01:00
parent 7bc548602c
commit 8b4bf47e4c

13
Schema/view.sql Normal file
View File

@ -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;