MySQL query Syntax with many to many relationship...
Posted on 2009-04-13
I have a table employees and a table shifts. They have a many to many relationship.
I want to be able to view the employees who are logged into two/three specific shifts.
So the query is kinda like this...
FROM EMPLOYEES INNER JOIN SHIFTS ON EMPLOYEES.EMP_ID = SHIFTS.EMP_ID
WHERE SHIFT_ID = (26 AND 27 AND 28)
except the where statement is clearly wrong. I want it to return the employees who are logged onto the shifts 26 AND 27 AND 28.
Please help with the syntax. Thanks in advance!