@millih2g SQLite version 3.46.1 2024-08-13 09:16:08 Enter ".help" for usage hints. sqlite> .tables events temperature_snapshots schema_migrations temperature_snapshots_stat temperature_log_settings temperature_snapshots_takte_heute sqlite> SELECT name FROM sqlite_master WHERE type='view'; temperature_snapshots_takte_heute sqlite> .schema name_der_tabelle_oder_view sqlite> .schema temperature_snapshots_stat CREATE TABLE temperature_snapshots_stat( id INT, timestamp TEXT, installation_id TEXT, gateway_id TEXT, device_id TEXT, account_id TEXT, account_name TEXT, outside_temp REAL, return_temp REAL, supply_temp REAL, primary_supply_temp REAL, secondary_supply_temp REAL, primary_return_temp REAL, secondary_return_temp REAL, dhw_temp REAL, dhw_cylinder_middle_temp REAL, boiler_temp REAL, buffer_temp REAL, buffer_temp_top REAL, calculated_outside_temp REAL, compressor_active INT, compressor_speed REAL, compressor_current REAL, compressor_pressure REAL, compressor_oil_temp REAL, compressor_motor_temp REAL, compressor_inlet_temp REAL, compressor_outlet_temp REAL, compressor_hours REAL, compressor_power REAL, circulation_pump_active INT, dhw_pump_active INT, internal_pump_active INT, volumetric_flow REAL, thermal_power REAL, cop REAL, four_way_valve TEXT, burner_modulation REAL, secondary_heat_generator_status TEXT, sample_interval INT, hp_primary_circuit_supply_temp REAL, hp_secondary_circuit_supply_temp REAL, heating_circuit_0_supply_temp REAL, heating_circuit_1_supply_temp REAL, heating_circuit_2_supply_temp REAL, heating_circuit_3_supply_temp REAL, heating_circuit_0_delta_t REAL, heating_circuit_1_delta_t REAL, heating_circuit_2_delta_t REAL, heating_circuit_3_delta_t REAL, compressor_starts REAL, four_way_valve_current REAL, four_way_valve_target REAL, pressure_supply REAL ); sqlite> SELECT COUNT(*) AS gesamt_zeilen, SUM(CASE WHEN elektrische_leistung IS NULL THEN 1 ELSE 0 END) AS zeilen_ist_null, SUM(CASE WHEN elektrische_leistung = 0 THEN 1 ELSE 0 END) AS zeilen_ist_null_wert, COUNT(elektrische_leistung) AS zeilen_mit_echten_werten FROM temperature_snapshots_stat; Parse error: no such column: elektrische_leistung COUNT(*) AS gesamt_zeilen, SUM(CASE WHEN elektrische_leistung IS NULL error here ---^ Aber es gibt: sqlite> SELECT COUNT(*) AS gesamt_zeilen, SUM(CASE WHEN compressor_power IS NULL THEN 1 ELSE 0 END) AS zeilen_ist_null, SUM(CASE WHEN compressor_power = 0 THEN 1 ELSE 0 END) AS zeilen_ist_null_wert, COUNT(compressor_power) AS zeilen_mit_echten_werten FROM temperature_snapshots_stat; 2334|0|2158|2334
... Mehr anzeigen