SELECT CONCAT_WS(',', Col1, Col2, Col3 ) AS combined FROM table_name
Currently if I have fields Col1 = 'hello', Col2 = 'Bye', Col2 = 'Goodnight'
The above select statement would return hello,Bye,Goodnight which is fine.
What if any of the Cols where blank. A Comma would still be added. like hello,,Goodnight.
Is there a way to say if the Col is empty then ignore it? (This is MySQL)