Dua kemungkinan solusi:
- Gunakan subkueri
- Gunakan variabel
Solusi subkueri
select a, a>2 as b
from (select 1 as a) as q;
Solusi 'variabel'
set @a = 1;
select @a as a, @a>2 as b;
Dua kemungkinan solusi:
Solusi subkueri
select a, a>2 as b
from (select 1 as a) as q;
Solusi 'variabel'
set @a = 1;
select @a as a, @a>2 as b;