I\'m trying to find a way to combine two columns into one, but keep getting the value \'0\' in the column instead to the combination of the words.
These are what I\'
It's work for me
SELECT CONCAT(column1, ' ' ,column2) AS newColumn;
This is the only solution that would work for me, when I required a space in between the columns being merged.
select concat(concat(column1,' '), column2)
convert(varchar, column_name1) + (varchar, column_name)
My guess is that you are using MySQL where the +
operator does addition, along with silent conversion of the values to numbers. If a value does not start with a digit, then the converted value is 0
.
So try this:
select concat(column1, column2)
Two ways to add a space:
select concat(column1, ' ', column2)
select concat_ws(' ', column1, column2)