How to subtract values from different queries

Hello,
I would need to subtract value from different queries but I cannot figure how how to do.
In fact any attempt done got an error 400.

Here are the queries:

A) select sum(wh)/1000 from (select mean_value /60  as wh from (SELECT mean(*)  FROM "power"."autogen"."generale_w" WHERE time > now()-24h GROUP BY time(1m) fill(none)))

B) select sum(wh)/1000 from (select mean_value /60  as wh from (SELECT mean(*)  FROM "power"."autogen"."lavatrice" WHERE time > now()-24h GROUP BY time(1m) fill(none)))
C) select sum(wh)/1000 from (select mean_value /60  as wh from (SELECT mean(*)  FROM "power"."autogen"."forno" WHERE time > now()-24h GROUP BY time(1m) fill(none)))
D) select sum(wh)/1000 from (select mean_value /60  as wh from (SELECT mean(*)  FROM "power"."autogen"."lavastoviglie" WHERE time > now()-24h GROUP BY time(1m) fill(none)))
E) select sum(wh)/1000 from (select mean_value /60  as wh from (SELECT mean(*)  FROM "power"."autogen"."frigorifero" WHERE time > now()-24h GROUP BY time(1m) fill(none)))

I would need to got a value from:

A - (B+C+D+E)

Could You hep me please?

Thank You

Regards

Hey @mauog, this unfortunately is a limitation of the current v1.x branch of influxdb, but is something that a lot of people have been asking about:

If you’re up for using the v2.0-alpha as a test, you can do this now! Check out this amazing post about doing just that:

1 Like

Thanks @sebito91,
as far as you know is there any workaround maybe using any other programs?