To mulige løsninger:
- Brug en underforespørgsel
- Brug en variabel
Underforespørgselsløsningen
select a, a>2 as b
from (select 1 as a) as q;
Den 'variable' løsning
set @a = 1;
select @a as a, @a>2 as b;
To mulige løsninger:
Underforespørgselsløsningen
select a, a>2 as b
from (select 1 as a) as q;
Den 'variable' løsning
set @a = 1;
select @a as a, @a>2 as b;