Changeset 9125727 for de.wigbels.ruby/hothotwrite/hhw.rb
- Timestamp:
- 11/20/2014 10:51:40 PM (10 years ago)
- Branches:
- master
- Children:
- adb0f52
- Parents:
- 4fd0ab9
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
de.wigbels.ruby/hothotwrite/hhw.rb
r4fd0ab9 r9125727 53 53 log.info("Inserted sensor: #{sensorid} with data: #{data}") 54 54 else 55 years = dbh.query( %Q"select count(distinct year(measuredat)) FROM sensor" ) 56 put years 55 57 # Auswertung Gesamtes Jahr, Monat, Vergleich Vorjahr 56 58 myquery = %Q{ select sum(data), 'Liter Verbrauch in #{month}-#{logyear}' \ … … 70 72 where year(measuredat) = '#{yearbefore}' 71 73 union 72 select truncate(avg(data) ,2), 'Durchschnittsverbrauch Gesamtjahr Liter/Tag' \74 select truncate(avg(data)/#{years},2), 'Durchschnittsverbrauch Gesamtjahr Liter/Tag' \ 73 75 from \ 74 76 (select sum(data) as data from sensor \ … … 76 78 as foo 77 79 union 78 select truncate(avg(data) ,2), 'Durchschnittsverbrauch Sommmer Liter/Tag' \80 select truncate(avg(data)/#{years},2), 'Durchschnittsverbrauch Sommmer Liter/Tag' \ 79 81 from \ 80 82 (select sum(data) as data from sensor \ … … 83 85 as foo 84 86 union 85 select truncate(avg(data) ,2), 'Durchschnittsverbrauch Winter Liter/Tag' \87 select truncate(avg(data)/#{years},2), 'Durchschnittsverbrauch Winter Liter/Tag' \ 86 88 from \ 87 89 (select sum(data) as data from sensor \
Note:
See TracChangeset
for help on using the changeset viewer.