Page 1 of 1

String combining operations in select

Posted: Fri Oct 20, 2006 7:43 pm
by Shendemiar
MySql

Can I select, say 2 columns to result as one, using + etc.

In php terms

Code: Select all

"text1"."text2"
Something like

Code: Select all

SELECT (a+b) as newstring FROM...

Posted: Fri Oct 20, 2006 8:38 pm
by aaronhall

Code: Select all

SELECT CONCAT(field1, " ", field2) FROM table
Will concatenate the two fields, and add a space in between