Possible to use IF in a query?
问题 I'm using Grafana to plot data from a MySQL datasource. Is it possible to, in a panel's query editor, use an IF ... THEN ... type statement. I would like to create a variable that I could put in the IF. I want the variable to be a condition, not necessarily to be used directly in the query. For example: //IN THE DATA SOURCE: CREATE TABLE Example (Id INT, ANIMALS VARCHAR(15)); INSERT INTO Example VALUES (1,'Dog'), (2,'Fish'), (3,'Cat'), (4,'Lizard') For a variable Test with values "Mammal',