0 value if previous value the same

First Post so apologies if i’m in the wrong place…

I’m trying simply to fill 0 into my chart if the previous value is the same. Basically i have an alert that keeps firing when a threshold is reached and stays unchanged over time unless another entry is made under the threshold

SELECT “list_0_wait_time” /60 AS “wait time (mins)” FROM “telegraf”.“autogen”.“chat” WHERE “server”=‘’ fill(0)