php - Combining created columns in MySQL -


i have mysql query returns columns different tables, column i've customized through case statement.

select table.column,  case (...) new_column  

the thing is, want concatenate table.column , new_column in query, although can't independently call new_column since created in query.

due database privileges, can't create tables on database.

thoughts on how should approach this?

you can wrap whole select concat() function:

select concat(table.column, case(...)) new_column table; 

another way of approaching it, not recommend may little more readable, use current query subquery , concatenate parent one:

select concat(column, new_column) new_column from(    select table.column, case(...) new_column    table ) tmp; 

Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -