内部联接查询的标识符错误无效

时间:2016-10-20 06:34:52

标签: sql oracle

SELECT adm.*
  FROM adm_bucket ab
 INNER JOIN lms_user_role_mapping urm ON urm.bucket_id = ab.bucket_id
 INNER JOIN lms_roles_privilege_mapping rpm ON rpm.role_id = urm.role_id
 WHERE urm.user_id =19375 
   AND ab.bucket_OWNER=19375;

---错误

ORA-00904: "from$_subquery$_003"."ROLE_ID": invalid identifier
00904. 00000 -  "%s: invalid identifier"
*Cause:    
*Action:
Error at Line: 1 Column: 220

1 个答案:

答案 0 :(得分:0)

在您的查询中,您还没有为任何表定义名为 adm 的别名,我认为这就是问题,要么根据您的要求将其设为ab。*或urm。*或rpm。*期望的结果。

SELECT adm.*
  FROM adm_bucket ab
 INNER JOIN lms_user_role_mapping urm ON urm.bucket_id = ab.bucket_id
 INNER JOIN lms_roles_privilege_mapping rpm ON rpm.role_id = urm.role_id
 WHERE urm.user_id =19375 
   AND ab.bucket_OWNER=19375;