I try to set the result of a select in a variable(To show it in my result) but I obtain an error
This is my code :
SELECT 8_Type,SET @var= (select Name from variables where Ch8_ID = variables.ID)
FROM TTable ;
and when I change my code like bellow, this is what I want but I need to change the name of the column :
SELECT 8_Type, (select Name from variables where Ch8_ID = variables.ID)
FROM TTable ;![enter image description here][1]
I obtain in the column the query like this image.

Provide a column alias for the expression…
SELECT expr AS my_namee.g.MySQL will return “my_name” as the label for the column (in the metadata) for the resultset.
(But it’s not at all clear what your SQL statement is trying to do though.)