I would like to make the name of a column dependent on a subquery in a MySQL SELECT call, but I don't know how to build the call.
example:
SELECT ts AS time, Temperatur AS (SELECT Name FROM SensorInfo WHERE id=8)
FROM Sensoren
WHERE id = 8;
The "SensorInfo" table contains the name that should be used as an alias for "Temperature". Of course, this call doesn't work. I'm trying to demonstrate what I'm trying to do. How can I implement this?