sql >> Base de Datos >  >> RDS >> Mysql

¿Puedo reutilizar una expresión en una consulta MySQL como variable para otro campo?

inserte el primer cálculo en una tabla derivada:

select variable1
     , complex_function(variable1, other_column) as variable2
     , yet_another column
  from (select complex_operation as variable1
             , other_column
             , yet_another_column
          from whatever) dt