您可以使用这样的查询:
SELECT SUBSTRING_INDEX(SUBSTRING_INDEX( CONCAT('|',n.Numbers,'|') , '|', i.id), '|', -1) AS nums
FROM num n
CROSS JOIN (
SELECT 2 AS id UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 ) AS i
HAVING nums <> ''
ORDER BY n.id
样本
MariaDB [num]> select * from num;
+----+--------------+
| id | Numbers |
+----+--------------+
| 1 | 111|1232|234 |
| 2 | 2|44|55|999 |
| 3 | NULL |
| 4 | 99|11 |
+----+--------------+
4 rows in set (0.000 sec)
MariaDB [num]> SELECT SUBSTRING_INDEX(SUBSTRING_INDEX( CONCAT('|',n.Numbers,'|') , '|', i.id), '|', -1) AS nums
-> FROM num n
-> CROSS JOIN (
-> SELECT 2 AS id UNION ALL SELECT 3 UNION ALL SELECT 4 UNION ALL SELECT 5 ) AS i
-> HAVING nums <> ''
-> ORDER BY n.id
-> ;
+------+
| nums |
+------+
| 111 |
| 1232 |
| 234 |
| 2 |
| 44 |
| 55 |
| 999 |
| 99 |
| 11 |
+------+
9 rows in set (0.001 sec)
MariaDB [num]>