我这样写为什么结果不对?
找了半天,也不知道哪儿出错了,大牛们,帮我看看啊,主要是a.id=2时,数据为空
select user_name,
replace(
substring(substring_index(mobile, ',', a.id),char_length(substring_index(mobile, ',', a.id-1)) + 1),',','') as mobile
from tb_sequence a
cross join (
select
user_name,
concat(mobile,',') as mobile,
length(mobile) - length(replace(mobile,',', ''))+1 size
from user1 b
) b on a.id <= b.size;