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

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -