I am trying to create a SOQL query that will give me contact and opportunity information from people in a specific campaign. I have done the following and I can get Contact information, but I am not sure how to make the connection to get the associated opportunity. I tried the following Opportunity.Name in the select but that does not work. Any ideas? I have just being trying this in the query editor but will be using this in an apex code callout.
SELECT CONTACT.FIRSTNAME FROM CAMPAIGNMEMBER WHERE CAMPAIGNID = 'MYCAMPAIGNID' AND CONTACT.ID !=null
To be more clear I am trying to get the opportunities associated with the Contacts in the Campaign. I am looking at the following objects Contacts, Opportunities and CampaignMembers. I do have Contact__c on the opportunity Object.