privilege表
RolePrivilege表
Role表
UserInfo表
?已知UserInfo的id求Privilege中所有数据,求教sql语句写法?
------解决方案--------------------
select
b.*
from
privilege as a,RolePrivilege as b,Role as c,UserInfo as d
where
a.id=b.Privilegeid
and
b.roleid=c.id
and
c.id=.id
and
d.id=xxx
Role和 UserInfo 怎么关联的?
------解决方案--------------------
那就按照这个吧D.ID 写你自己想查询的ID