Table name employee
Emp_id Emp_name emp_language
1 john Java
2 Ragul Python
3 April Java
I need a query to get output like
1,john,Java
2,Ragul,Python
3,April,Java
CodePudding user response:
You can use CONCAT_WS()
function such as
SELECT CONCAT_WS(',',Emp_id,Emp_name,emp_language)
FROM employee
which is similar to CONCAT()
but no need to repeat the seperator by keeping as the first argument.