----------
User
----------
user_ID(pk)
UserEmail
----------
Employer1
----------
Emp1ID(pk)
Emp1NO
----------
Employer2
----------
Emp2ID(pk)
Emp2NO
----------
Project
----------
ProjEmpID
ProjEmpMGRID
I need to display User Email ID. The relation between the table goes like this: In the Employer(1&2) table EmpID contains the value of UserID in the User table.
the Employer No relates to the values from the Project table. EmpNo contains values from ProjEmpID, ProjEmpMGRID.
select u.user_email from users u, Employer emp
where emp.Emp1ID = u.user_id and
emp.Emp1NO IN
(select ProjEmpID,ProjEmpMGRID from project)
union
select u.user_email from users u, Employer emp
where emp.Emp2ID = u.user_id and
emp.Emp2NO IN
(select ProjEmpID,ProjEmpMGRID from project)
but i get error in the subquery stating too many parameters on the IN clause.Is there any other way i could rewrite the query to get result. any help would be appreciated.