Check your output again because it's inconsistent. You might be looking for either of the
string functions CONCAT or CONCAT_WS. You might need a GROUP BY clause on your statement to make it work.
Before you start wondering how to make this work I suggest that you start by fixing the other errors in your statement and enjoy the speed increases they give.