title: MySQL right outer join query
body: <p>I have a query regarding a query in MySQL.</p>
  
  <p>I have 2 tables one containing SalesRep details like name, email, etc. I have another table with the sales data which has reportDate, customers served and link to the salesrep via a foreign key. One thing to note is that the reportDate is always a friday.</p>
  
  <p>So the requirement is this: I need to find sales data for a 13 week period for a given list of sales reps - with 0 as customers served if on a particular friday there is no data. The query result is consumed by a Java application which relies on the 13 rows of data per sales rep. </p>
  
  <p>I have created a table with all the Friday dates populated and wrote a outer join like below:</p>
  
  <pre><code>select * from (
           select name, customersServed, reportDate 
           from Sales_Data salesData
           join `SALES_REPRESENTATIVE` salesRep on salesRep.`employeeId` = salesData.`employeeId`
           where employeeId = 1   
      ) as result 
      right outer join fridays on fridays.datefield = reportDate
      where fridays.datefield between '2014-10-01' and '2014-12-31'
     order by datefield
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/6wmXO.png" alt="enter image description here"></p>
  
  <p>Now my doubts: </p>
  
  <ul>
  <li><p>Is there any way where i can get the name to be populated for all 13 rows in the above query?</p></li>
  <li><p>If there are 2 sales reps, I'd like to use a IN clause and expect 26 rows in total - 13 rows per sales person (even if there is no record for that person, I'd still like to see 13 rows of nulls), and 39 for 3 sales reps</p></li>
  </ul>
  
  <p>Can these be done in MySql and if so, can anyone point me in the right direction?</p>