I am trying to write a query to obtain all employee salary details. My experience in Oracle Cloud is limited and I have mostly used MSSQL instead of Oracle SQL. However, my attempt is this:
SELECT P.Person_Number,
A.Effective_Start_Date AS StartDateAssignment,
SAL.Effective_Start_Date AS StartDateSalary,
SAL.Salary_Amount,
A.Assignment_ID,
AR.ACTION_REASON AS Reason
FROM Per_All_Assignments_f A
INNER JOIN CMP_SALARY SAL ON SAL.Assignment_ID = A.Assignment_ID
INNER JOIN Per_People_f P ON P.Person_ID = A.Person_ID
INNER JOIN Per_Action_Reasons_TL AS AR ON AR.ACTION_REASON_ID = SAL.ACTION_REASON_ID
This code is incorrect (missing keyword error). Can anyone give me some tips?
Thanks a lot!
KR
In your code all you have done wrong is that you have entered word 'AS' on your las INNER JOIN line command before the alias. I believe this will work:
SELECT P.Person_Number,
A.Effective_Start_Date AS StartDateAssignment,
SAL.Effective_Start_Date AS StartDateSalary,
SAL.Salary_Amount,
A.Assignment_ID,
AR.ACTION_REASON AS Reason
FROM Per_All_Assignments_f A
INNER JOIN CMP_SALARY SAL ON SAL.Assignment_ID = A.Assignment_ID
INNER JOIN Per_People_f P ON P.Person_ID = A.Person_ID
INNER JOIN Per_Action_Reasons_TL AR ON AR.ACTION_REASON_ID = SAL.ACTION_REASON_ID
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.