You need to sign in to do that
Don't have an account?
dave_mwi
SOQL sub select - checking for subselect equal to NULL
I have the following soql statement:
Select o.Id, (Select ContactId From OpportunityContactRoles) From Opportunity o
However, some of the opportunities don't have contact roles...so this query retrieves all of my opportunities with our without contact roles. I'm using the Force IDE along with the schema browser and this shows up as a two-columned table with one of the columns being an OpportunityContactRole object - titled 'OpportunityContactRoles' and no, trying OpportunityContactRoles != NULL in the main query didn't work.
So my question is, how do I only get the opportunities that only have associated opportunity contact roles?
Select o.Id, (Select ContactId From OpportunityContactRoles) From Opportunity o
However, some of the opportunities don't have contact roles...so this query retrieves all of my opportunities with our without contact roles. I'm using the Force IDE along with the schema browser and this shows up as a two-columned table with one of the columns being an OpportunityContactRole object - titled 'OpportunityContactRoles' and no, trying OpportunityContactRoles != NULL in the main query didn't work.
So my question is, how do I only get the opportunities that only have associated opportunity contact roles?
Ron Hess
what about this type of query
Code: