Problem with dynamic graphs

I have local database MySql in Apache2 XAMPP server. In MySql, I have database server with example_tables, example2, example3 tables. Every tables have id, date, total, score, Rising columns.

Later. I would like create a dynamic graphs in my Grafana. In Grafana, I create a custom variable tabela with definition example_table, example2, example3, and second variable kolumna with definition: score, date, Rising.

Later. In Grafana. I create row $tabela with repeat for tabela option. I create Visualisation in row. Visualisation have title $kolumna with repeat by variable kolumna option.

Later, In my Visualisation, I use SQL query:
USE server;
SELECT date, $kolumna FROM $tabela;
but I get error:

db query error: Error 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ‘SELECT date, ‘score’ FROM ‘example2’’ at line 2

I would like create a dynamic graphs and rows in my project, but I have this problem.

I use this sql query:

SELECT date, ${kolumna:csv} FROM ${tabela:csv}

and now is everything oke :wink:

1 Like