Skip to content
Advertisement

How to modify result of select statement based on values?

I am not MySQL guy just learning by doing things, I have database that stores value 0 or 1, now in grafana I want to display online if value yield from select statement is 1 and offline if value of online in select statement is 0.

So far this is what I wrote

But select statement through error.

Advertisement

Answer

You’re looking for a case expression:

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement