union和union all 合並2條或者多條sql:
union 合並后會踢重
union all 合並后有不會踢重

SELECT * FROM t_mp_resources WHERE id in
(SELECT DISTINCT resId FROM (
SELECT resId FROM t_mp_user_res WHERE userId = 1
UNION ALL
SELECT resId FROM t_mp_role_res WHERE roleId in (SELECT roleId FROM t_mp_user_role WHERE userId= 1)
)
tmp
)



