In a MySQL SELECT statement, how can a derived field utilise the value of another field in the SELECT list?
For example, when running the following query:
SELECT
'tim' AS first_name
,first_name || ' example' AS full_name;
I would expect the result to be:
first_name, full_name
tim , tim example
Instead, I get the following error:
Unknown column 'first_name' in 'field list'.
Is there a way I can reference another column?
Thanks
Turgs
No, you have to repeat it or use a derived table.