title: Combine two SOQL queries
body: <p>I am a beginner concerning SOQL, I hope you can help me.
  I would like to combine these two queries:</p>
  
  <p><strong>Query 1:</strong></p>
  
  <pre><code>SELECT Id, Category__c, Segment__c
  FROM Account
  WHERE (Category__c = 'Prospect' AND Segment__c = 'High') OR (Category__c = 'Referrer' AND Segment__c = 'High')
  </code></pre>
  
  <p><strong>Query 2:</strong></p>
  
  <pre><code>SELECT Account_vod__c, WEEK_IN_YEAR(Call_Date_vod__c), CALENDAR_YEAR(Call_Date_vod__c)
  FROM Call2_vod__c
  WHERE Call_Date_vod__c = LAST_N_WEEKS:7
  GROUP BY Account_vod__c, Call_Date_vod__c
  </code></pre>
  
  <p>Where the id of Account should equal the Account_vod__c value from Call2_vod__c. </p>
  
  <p>When I combine these, I get something as:</p>
  
  <p><strong>Combined Query:</strong></p>
  
  <pre><code>SELECT Id, Category__c, Segment__c
  FROM Account
  WHERE id in (select Account_vod__c from Call2_vod__c where Call_Date_vod__c = LAST_N_WEEKS:7) AND ((Category__c = 'Prospect' AND Segment__c = 'High') OR (Category__c = 'Referrer' AND Segment__c = 'High'))
  </code></pre>
  
  <p>But now I am missing the Week and Year values:</p>
  
  <pre><code>WEEK_IN_YEAR(Call_Date_vod__c), CALENDAR_YEAR(Call_Date_vod__c)
  </code></pre>
  
  <p>and this part:
      GROUP BY Account_vod__c, Call_Date_vod__c</p>
  
  <p>How Can I combine these queries and display the right week and calendar data? </p>
  
  <p>Thanks!</p>