MYSQL - Unknown column 'a' in 'field list' -
when running query works perfectly:
select 10 a;
but when using column a
select 10 a, (a - 1) b
i following error: unknown column 'a' in 'field list'
why isn't working way?
you can't reuse alias in same select
statement in defined. perhaps closest thing want here this:
select t.a, (t.a - 1) b (select 10 dual) t;
Comments
Post a Comment