CONCATE_WS()

This function was used to join two or more string with separator to make a single string.
SELECT CONCAT_WS(‘,’, id, country_code, country_name)
FROM apps_countries
where country_name =’Pakistan’

Description

In the above example, was used as a separator and it join the id, country_name and country _code and make a single string.

Output

CONCAT_WS(‘,’,id,country_code,country_name)
167,PK,Pakistan

Advertisements