You need to sign in to do that
Don't have an account?
vishnu nv
Manager List : SOQL Error
Hi,
I am trying to retrieve all the managers from the account with the below SOQL query.
SELECT Name FROM User WHERE ManagerId IN (SELECT ManagerId FROM User WHERE ManagerId !=NULL)
But i am facing error :
The inner and outer selects should not be on the same object type
Do we have any other alternatives ?
I am trying to retrieve all the managers from the account with the below SOQL query.
SELECT Name FROM User WHERE ManagerId IN (SELECT ManagerId FROM User WHERE ManagerId !=NULL)
But i am facing error :
The inner and outer selects should not be on the same object type
Do we have any other alternatives ?
Can you try the below query and let me know if this work in your use case.
You cannot query on the same object in a subquery as in the main query.Because of which you faced the above error.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,
All Answers
Can you try the below query and let me know if this work in your use case.
You cannot query on the same object in a subquery as in the main query.Because of which you faced the above error.
Let me know if you face any issues.
If this solution helps, Please mark it as best answer.
Thanks,