I need to use group_concat to build a list of comma separated values but I need the values to be quoted. How do I do this?
This:
425,254,431,53,513,13,1,13
Should be converted to:
'425','254','431','53','513','13','1','13'
I need to use group_concat to build a list of comma separated values but I need the values to be quoted. How do I do this?
This:
425,254,431,53,513,13,1,13
Should be converted to:
'425','254','431','53','513','13','1','13'
You can quote the elements before applying GROUP_CONCAT
.
SELECT GROUP_CONCAT(CONCAT('\'', some_column, '\''))
FROM some_table