這樣寫更簡潔一些:
SELECT
user_name,
substring_index(substring_index(mobile, ',', a.id),',' ,- 1) AS mobile
FROM
tb_sequence a
CROSS JOIN (
SELECT user_name, mobile,
(length(mobile) - length(REPLACE(mobile, ',', '')) + 1) AS size
FROM
user1
) b ON a.id <= b.size