sqlserver以逗号隔开的记录一行转多行sql
select
b.roleid
from
(select name,roleid=convert(xml,'<root><v>'+replace(roleid,',','</v><v>')+'</v></root>') from dc_jsjy_EduUser where id='499')a
outer apply
(select roleid=C.v.value('.','nvarchar(100)') from a.roleid.nodes('/root/v')C(v))b