sql语句:查询几个相关字段(user表、role权限表,user_role关联表),查出当role_code 的固定值,在where条件中用in
select r.role_code as username
from sys_user u , sys_user_role ur ,sys_role r
where realname =''小明" and ur.user_id=u.id and r.id = ur.role_id
and role_code in ('S021','S099')
GROUP BY r.role_name