I am trying to add two columns as one column by using this statement
SELECT (member_Firstname+''+member_Lastname) AS Name FROM members but it gives all 0 values in mysql workbench
I am trying to add two columns as one column by using this statement
SELECT (member_Firstname+''+member_Lastname) AS Name FROM members but it gives all 0 values in mysql workbench
SELECT concat(member_Firstname,'',member_Lastname) AS Name FROM members; This should work always
Adding is for numbers; for joining strings, use concat()
SELECT CONCAT(string1,string2,string3,etc) FROM table SELECT CONCAT(CAST(int_col AS CHAR), char_col); CONCAT() returns NULL if any argument is NULL.
So for the example
SELECT CONCAT(member_Firstname, member_Lastname);