0

这个查询抛出错误ORA-00904: invalid identifier,谁能告诉我为什么?

select papf.person_id, papf.person_number, ppnf.DISPLAY_NAME
from per_people_f papf, PER_PERSON_NAMES_F ppnf
where
papf.person_id=ppnf.person_id
and papf.person_id not in (select cs.person_id from cmp_salary cs where cs.person_id is not null and cs.ASSIGNMENT_ID is null )
and papf.person_id not in (select cse.person_id from cmp_salary_export cs where cse.person_id is not null and cse.ASSIGNMENT_ID is null )
and ppnf.name_type='US'
order by papf.person_id
4

1 回答 1

1

这是一个错字。在第二个子查询中,您为所有列引用cse.设置了别名,但您为 table 设置了别名cs

(select cse.person_id
 from cmp_salary_export cs 
 where cse.person_id is not null 
 and cse.ASSIGNMENT_ID is null )

用适当的缩进布置代码不仅仅是迂腐:让它更容易阅读也更容易调试。

于 2017-04-10T07:34:19.423 回答