mysql - SQL Query with Alias and Re-use it. how its work? -


i have query using alias 'as' example:

select (table_a.name) name_a table_b id = 1 

what im trying re-call/re-use name_a next column like:

select (table_a.name) name_a, (name_a+"me") name_b table_b id = 1 

how can that?? thx advance. have nice day

you cannot reference select list alias in same select list. mysql documentation on select list aliases says:

a select_expr can given alias using alias_name. alias used expression's column name , can used in group by, order by, or having clauses.

you need wrap aliased select expression subquery , can use aliased expression in outer query. or refer field under original name.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -