add batch remove batch split batch comment selection show hidden batches hide batch highlight batch
db<>fiddle
donate feedback about
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
version()
8.0.23
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(SELECT x.timest,
          max(CASE WHEN x.devloc='outside' THEN x.value END) A' at line 6
EXPLAIN
-> Group aggregate: max((case when (x.devloc = 'hvac_main_supply') then x.`value` end)), max((case when (x.devloc = 'hvac_main_return') then x.`value` end)), max((case when (x.devloc = 'outside') then x.`value` end)), max((case when (x.devloc = 'hvac_main_return') then x.`value` end)), max((case when (x.devloc = 'hvac_main_supply') then x.`value` end)) (actual time=0.010..0.010 rows=0 loops=1)
    -> Filter: (cast(x.timest as date) = <cache>(curdate())) (cost=0.35 rows=1) (actual time=0.009..0.009 rows=0 loops=1)
        -> Index scan on x using timest (cost=0.35 rows=1) (actual time=0.008..0.008 rows=0 loops=1)
EXPLAIN
-> Sort: y.timest DESC (actual time=0.004..0.004 rows=0 loops=1)
    -> Table scan on y (cost=2.73 rows=2) (actual time=0.000..0.000 rows=0 loops=1)
        -> Materialize (actual time=0.020..0.020 rows=0 loops=1)
            -> Group aggregate: max((case when (x.devloc = 'outside') then x.`value` end)), max((case when (x.devloc = 'hvac_main_return') then x.`value` end)), max((case when (x.devloc = 'hvac_main_supply') then x.`value` end)) (actual time=0.010..0.010 rows=0 loops=1)
                -> Filter: (cast(x.timest as date) = <cache>(curdate())) (cost=0.35 rows=1) (actual time=0.009..0.009 rows=0 loops=1)
                    -> Index scan on x using timest (cost=0.35 rows=1) (actual time=0.009..0.009 rows=0 loops=1)