I have table employee which contains about 9 columns . ' id,name,etc..'
and I have another table 'onCall' contain 3 columns 'employee_id,department_id and rank '
what I want is to retrieve the employee data who is registered as OnCall employee on this department
I try this to get the employee data :
Select * from employee where id in (SELECT employee_id FROM onCall where department_id = 3)
This calls for an inner join
select EMP.*, OC.* from EMPLOYEE EMP inner join ONCALL OC on OC.EMPLOYEE_ID = EMP.ID where OC.DEPARTMENT = 3