I've created a Grafana dashboard variable (multi-select enabled) based on a MySQL query:
SELECT DISTINCT(my_field) from my_table
This field has about 12 options, one of them being a NULL value. When editing my dashboard widgets, I include a SQL constraint similar to:
... WHERE my_field IN ($my_variable)
This almost works well, except for the NULLs. Grafana is translating the NULL to ''
, and NULL isn't supported in an IN (...)
statement anyway.
Any recommendations on how to handle this to work with NULLs?