How to join three table.
I want to select the department id column from the department table of the person.If I want to select the status id from the staff table according to those personid and departmentid.
I want to select columns from tables.
DEPARTMENT --> DEPARTMENTID (PERSONID,DEPARTMENTID)
STATUS --> STATUSID (DEPARTMENTID,STATUSID)
What I have tried:
SELECT ID,DEPARTMENTID,STATUSID FROM PERSON WHERE CLASSID=1
SELECT DEPARTMENTID FROM DEPARTMENT WHERE (SELECT ID,DEPARTMENTID FROM PERSON)
SELECT STATUSID FROM STATUS WHERE (SELECT DEPARTMENTID,STATUSID FROM DEPARTMENT)