I have a query with complicated column, and I would like to use this column result in another column, for instance:
SELECT ( /* Complex query */ ) as myValue, if( myValue > 10, "OK" , "" ) from table;
but his query returns an error:
Error Code: 1054. Unknown column 'myValue' in 'field list
How can I reuse a already calculated field?