Dos posibles soluciones:
- Usar una subconsulta
- Usar una variable
La solución de subconsulta
select a, a>2 as b
from (select 1 as a) as q;
La solución 'variable'
set @a = 1;
select @a as a, @a>2 as b;
Dos posibles soluciones:
La solución de subconsulta
select a, a>2 as b
from (select 1 as a) as q;
La solución 'variable'
set @a = 1;
select @a as a, @a>2 as b;