database - Use concat with as inside concat funcation in MySQL -



database - Use concat with as inside concat funcation in MySQL -

i have 3 columns in table: firstname, lastname , jobtitle. want concat firstname , lastname fullname concat fullname , jobtitle. how can that?

you do:

select concat_ws(' ', firstname, lastname) name, concat_ws(' ', firstname, lastname, jobtitle) nametitle

you cannot re-use column alias in same select, have repeat expression.

edit:

if want 1 column of form, perhaps:

select concat(firstname, ' ', lastname, ', ', jobtitle)

mysql database concatenation alias

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -