admin所属角色组字段内容(id)为:1
admin角色组对应的角色字段内容(id)为:1,2,3,5,6,7,8,9,10,11,12
select s.*,r.* from(select e.*,g.rolesfrom employee e inner join roleGroup gon e.rolegroupid=g.idwhere e.account='admin')s,role rwhere ','+s.roles+',' like '%,'+cast(r.id as varchar(10))+',%'
查询字段简化后的显示效果图: