Some math with Grafana


I am doing some math in Grafana. I struggle to get the Temperature read out from the Data base and bring it in the formular. How can i get instead of the 21 a sql query that read out the real value from the Database. As i am not sure if i explaned the difficultnes correct please have a look on the attached picture.

How to replace the 21 with a SQL

Thx for any advice