Mysql : use variable as 'toto' in graph like value

Hi all,

i would like use a temporarly column created on my request SQL like a value to create my Axe Y

    SELECT

UNIX_TIMESTAMP((date(climbing_time))) as time_sec, TIMESTAMPDIFF(MINUTE, climbing_time, c.date) as time,
time as value,
number as metric

My value time have the result = climbing_time - c.date

when i write “time as value” Grafana returns me an error : column fileds not exist
but when i try in mysql, this column exist

anyone can help me or maybe there is an other solution ?

Thanks

done :
SELECT
UNIX_TIMESTAMP((date(climbing_time))) as time_sec,
TIMESTAMPDIFF(MINUTE, climbing_time, c.date) as value,
number as metric

my formule directly --> as value

1 Like