sir I want to fetch “RightName” on lable from RIGHT_MASTER table according to “UserName” from USERS table, using below 5 tables.
database tables are:-
USER_GROUP:
Id
|
GroupId
|
UserId
|
1
|
1
|
1
|
2
|
2
|
2
|
3
|
3
|
3
|
USERS:
Id
|
UserName
|
1
|
opuser
|
2
|
engg
|
3
|
admin
|
4
|
abc
|
5
|
xyz
|
GROUP_MASTER:
Id
|
GroupName
|
1
|
operation
|
2
|
engineering
|
3
|
administrator
|
4
|
poweruser
|
5
|
user
|
RIGHT_MASTER:
Id
|
RightName
|
1
|
Read
|
2
|
write
|
3
|
execute
|
4
|
Add new
|
5
|
filter
|
6
|
Access to button
|
GROUP_RIGHTS:
RightId
|
UserGroup_id
|
1
|
3
|
4
|
3
|
10
|
3
|
3
|
3
|
5
|
2
|
7
|
2
|
2
|
1
|
and relation between each table is:-
USERS Inner join USER_GROUPS ON USERS.Id=USER_GROUPS.UserId
USER_GROUP Inner join GROUP_MASTER ON USER_GROUP.GroupId=GROUP_MASTER.Id
USER_GROUP Inner join GROUP_RIGHTS ON USER_GROUP.Id= GROUP_RIGHTS.UserGroup_Id
GROUP_RIGHTS Inner join RIGHT_MASTER ON GROUP_RIGHTS .RightId=RIGHT_MASTER.Id
im unable to make its nested query.
please hepl.