mysql split string to multiple row
CREATE TABLE tablename ( id INT, name VARCHAR(20)); INSERT INTO tablename VALUES (1, 'a,b,c'), (2, 'd'); CREATE TABLE numbers ( n INT PRIMARY KEY); INSERT INTO numbers VALUES (1),(2),(3),(4),(5),(6); If you can create a numbers table, that contains numbers from 1 to the maximum fields to split, you could use a solution like this: SELECT tablename.id, SUBSTRING_INDEX(SUBSTRING_INDEX(tablename.nam..
2020.11.06