subquery using IN clause

前端 未结 4 1716
[愿得一人]
[愿得一人] 2021-01-15 06:02
----------
User
----------
user_ID(pk)
UserEmail

----------
Employer1
----------
Emp1ID(pk)
Emp1NO

----------
Employer2
----------
Emp2ID(pk)
Emp2NO

----------
Pr         


        
4条回答
  •  自闭症患者
    2021-01-15 06:40

    You can only return one column from your subquery. If you just want both the employee ID and manager ID consider a union query as your subquery:

        emp.Emp2NO IN
    (select ProjEmpID from project
     union
     select ProjEmpMGRID from project)
    

    or rewriting to use two IN queries with separate subqueries for each.

提交回复
热议问题