queries
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
2023-12-14 15:56:04 +01:00
parent b9203c4cb3
commit 084f9fbf31
3 changed files with 30 additions and 0 deletions

20
queries/pg.sql Normal file
View File

@ -0,0 +1,20 @@
create or replace view power_v as
select time,
cast(values->'ActivePowerL1'->>'value' as float) as power_l1,
cast(values->'ActivePowerL2'->>'value' as float) as power_l2,
cast(values->'ActivePowerL3'->>'value' as float) as power_l3,
device
from measurements
where application = 'com-passavant-geiger-poc' and
attributes->>'FPort' = '1';
create or replace view power_factor_v as
select time,
cast(values->'PowerfactorL1'->>'value' as float) as factor_l1,
cast(values->'PowerfactorL2'->>'value' as float) as factor_l2,
cast(values->'PowerfactorL3'->>'value' as float) as factor_l3,
device
from measurements
where application = 'com-passavant-geiger-poc' and
attributes->>'FPort' = '1';