TABLE: Users UserId RoleId FullName ----------- ----------- ---------------- 38 14 Some One 39 15 Aother Person TABLE: Roles RoleId RoleName RoleCode ----------- ------------- -------- 31 Administrtor adm 32 Shipping shp 33 Receiving rcv TABLE: Rights RightId RightName RightCode Access ----------- ------------------- --------------------- ------ 10 Login login 1 11 View Ship Items vw_shipitems 1 TABLE: RoleRights RoleRightId RoleId RightId Access ----------- ----------- --------- ---------- 16 32 10 NULL 17 32 11 NULL TABLE: UserRights UserRightId UserId RightId Access ----------- ----------- --------- ---------- 17 32 11 0 25 33 18 0I know how to do this with temp tables, but can someone show me how to code this in a query, if it's possible?