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 -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -