Get a value or zero from a SELECT

Hi everyone,

I have a query like SELECT "papp" FROM "data" WHERE "ptec" = 0 AND $timeFilter that return me the value of “papp” when “ptec” = 0, it’s ok. But when “ptec” is not 0 (the other value is 1), I want the query to return 0 (or null), so my graph will not draw that serie.
How can I do that ?

Thanks

You didn’t mention used TSDB. I guess you are using InfluxDB, where non empty return value for an empty result/match is not possible.

Yes, InfluxDB… Crying !