Hi,
I am a new user of Grafana, I am not yet very cumfortable with query editor. That is why, i use SQL editor.
My first request works well, and with the gauge I have what I want :
SELECT
submitdate AS “time”,
150703X172X2661 AS metric,
avg(150703X172X2661) AS “Moyenne”
FROM ask_survey_150703
WHERE
$__timeFilter(submitdate)
ORDER BY submitdate
My second request doesn’t work, I would like to bypass the time component to have a “picture” of the average of this variable 150703X172X2661 (AXIS Y) according to this variable (AXIS X) attribute_4 (token is the link between both tables), on a Graph :
SELECT Avg(ask_survey_150703.150703X172X2661), ask_tokens_150703.attribute_4
FROM ask_survey_150703 INNER JOIN ask_tokens_150703 ON ask_survey_150703.token = ask_tokens_150703.token
GROUP BY ask_tokens_150703.attribute_4
HAVING ask_tokens_150703.attribute_4<>""
With this error message, that I understand : Found no column named time or time_sec
So, my third request :
SELECT submitdate AS “time”
Avg(ask_survey_150703.150703X172X2661), ask_tokens_150703.attribute_4
FROM ask_survey_150703 INNER JOIN ask_tokens_150703 ON ask_survey_150703.token = ask_tokens_150703.token
GROUP BY ask_tokens_150703.attribute_4
HAVING ask_tokens_150703.attribute_4<>""
With this error message, that I don’t understand : Error 1064: 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 ‘Avg(ask_survey_150703.150703X172X2661), ask_tokens_150703.attribute_4
FROM ask_’ at line 2
So my last request : the community
Thanks for your help,
Regards,
Christophe.