How to use inner join to join tables implemented with where clause in SQL?

  mysql, question

RBAC(Role-Based Access Control) is implemented with 5 tables:

User table rbac_user(id, name)
 Role table rbac_role(id, name)
 Operation table rbac_oper(id, name)
 The user's corresponding role table RBAC _ relation _ user _ role (user _ id, role _ id)
 The operation table corresponding to the role RBAC _ RELATION _ ROLE _ OPER (ROLE _ ID, OPER _ ID, VALUE)

Create tables and insert data:

CREATE TABLE `rbac_user` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(255) NOT NULL DEFAULT '',
 PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
 
 CREATE TABLE `rbac_role` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(255) NOT NULL DEFAULT '',
 PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
 
 CREATE TABLE `rbac_oper` (
 `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
 `name` varchar(255) NOT NULL DEFAULT '',
 PRIMARY KEY (`id`)
 ) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8;
 
 CREATE TABLE `rbac_relation_user_role` (
 `user_id` int(10) unsigned NOT NULL,
 `role_id` int(10) unsigned NOT NULL,
 UNIQUE KEY (`user_id`, `role_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 CREATE TABLE `rbac_relation_role_oper` (
 `role_id` int(10) unsigned NOT NULL,
 `oper_id` int(10) unsigned NOT NULL,
 `value`   int(10) unsigned NOT NULL,
 UNIQUE KEY (`role_id`, `oper_id`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
 
 INSERT INTO rbac_user VALUES(1,' Zhang Sanfeng');
 INSERT INTO rbac_role VALUES(1,' administrator');
 INSERT INTO rbac_oper VALUES(1,'foo');
 INSERT INTO rbac_oper VALUES(2,'bar');
 INSERT INTO rbac_relation_user_role VALUES(1,1);
 INSERT INTO rbac_relation_role_oper VALUES(1,1,1);
 INSERT INTO rbac_relation_role_oper VALUES(1,2,0);

Use where clause to join tables to obtain the operation permission of user number 1:

select rbac_oper.name, rbac_relation_role_oper.value
 from rbac_user, rbac_role, rbac_oper, rbac_relation_user_role, rbac_relation_role_oper
 where rbac_relation_user_role.user_id = rbac_user.id
 and   rbac_relation_user_role.role_id = rbac_role.id
 and   rbac_relation_role_oper.role_id = rbac_role.id
 and   rbac_relation_role_oper.oper_id = rbac_oper.id
 and   rbac_user.id = 1
 Results:
 name  value
 foo     1
 bar     0

The question now is how to write the same result with inner join.
If I write this way, I will prompt an error:

select * from
 rbac_relation_user_role
 inner join rbac_user on rbac_relation_user_role.user_id = rbac_user.id
 inner join rbac_role on rbac_relation_user_role.role_id = rbac_role.id
 inner join rbac_role on rbac_relation_role_oper.role_id = rbac_role.id
 inner join rbac_oper on rbac_relation_role_oper.oper_id = rbac_oper.id
 where rbac_user.id = 1
 Error: # 1066-notunique table/alias:' rbac _ role'
select rbac_oper.name, rbac_relation_role_oper.value
 from rbac_user, rbac_role, rbac_oper, rbac_relation_user_role, rbac_relation_role_oper
 where rbac_relation_user_role.user_id = rbac_user.id
 and   rbac_relation_user_role.role_id = rbac_role.id
 and   rbac_relation_role_oper.role_id = rbac_role.id
 and   rbac_relation_role_oper.oper_id = rbac_oper.id
 and   rbac_user.id = 1

Is equivalent to the following inner join (abbreviated join)

select rbac_oper.name, rbac_relation_role_oper.value
 from rbac_relation_user_role
 join rbac_user               on rbac_relation_user_role.user_id = rbac_user.id
 join rbac_role               on rbac_relation_user_role.role_id = rbac_role.id
 join rbac_relation_role_oper on rbac_relation_role_oper.role_id = rbac_role.id
 join rbac_oper               on rbac_relation_role_oper.oper_id = rbac_oper.id
 where rbac_user.id = 1

Note the following:
join rbac_relation_role_oper on rbac_relation_role_oper.role_id = rbac_role.id
Can’t write:
join rbac_role on rbac_relation_role_oper.role_id = rbac_role.id
Because to ensure that all tables that need to be associated are joined, the same table cannot be joined twice.