NametagEdit

721k Downloads

Use trim in substring index

snaigius123 opened this issue ยท 0 comments

commented

Hello I have this code:

SELECT ltdataset.id, SUBSTRING_INDEX(SUBSTRING_INDEX(ltdataset.artists, ',', numbers.n), ',', -1) name, popularity FROM (SELECT 1 n UNION ALL SELECT 2 UNION ALL SELECT 3 UNION ALL SELECT 4) numbers INNER JOIN ltdataset ON CHAR_LENGTH(ltdataset.artists) -CHAR_LENGTH(REPLACE(ltdataset.artists, ',', ''))>=numbers.n-1 order by id

And get artist names like "D'Angelo"] or ["D'Angelo" . so how to remove this thing from column ' [ , ] , " '
artist names are splited from array

Using MySQL