Deux solutions possibles :
- Utiliser une sous-requête
- Utiliser une variable
La solution de sous-requête
select a, a>2 as b
from (select 1 as a) as q;
La solution "variable"
set @a = 1;
select @a as a, @a>2 as b;
Deux solutions possibles :
La solution de sous-requête
select a, a>2 as b
from (select 1 as a) as q;
La solution "variable"
set @a = 1;
select @a as a, @a>2 as b;