I am trying create a dynamic dashboard in grafana 7.4.x with variables that can be selected. This works with one exception. In case there is no value selected, the value is empty and will result in a MySQL (5.7.32) error.
$value = 1,2,3
SELECT *
FROM TEST
WHERE ID IN ( ${test:csv} )
empty value results in :
$value = ''
SELECT *
FROM TEST
WHERE ID IN ( )
How can this query be rewriten in order to not result in an error but simply ignore this one where statement (as there are many ANDs)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…