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
Post a Comment