How to add single quote in mysql

I need help to find out some kind of solution in mysql.

Here is my line

IT, business, IT and software development, IT services, ERP Solution, industrial supply, IT and software development

and I want this type of output using mysql query.

"IT", "Business", "IT and software development", "IT services", "ERP" "Solution", "Industrial supply", "IT and software development"

Any help would be greatly appreciated.

+4
source share
1 answer

Try the following:

SELECT CONCAT("'",
            REPLACE("IT,Business,IT & Software Development, IT Services, ERP Solution,Industrial Supply,IT & Software Development",",","','"),
        "'");

SQL Fiddle: http://sqlfiddle.com/#!9/9eecb/19140

+2
source

Source: https://habr.com/ru/post/1694522/


All Articles