title: How can I get data from two different tables, link it to data from a third table, and get everything on a single report?
body: <p>I'm having a bit of trouble here. I have two different tables, one that stores the number of impressions a particular banner has had on the website per day and per user, and another the number of e-mails that have been sent any user any given date. </p>
  
  <p>A bit like this:</p>
  
  <pre>
  BANNERS
  
  DATE     USER_ID CLIENT_ID BANNER_ID IMPRESSIONS
  ________ _______ _________ ________ ___________
  04/05/11 AX745   CC        CC45      4  
  04/05/11 AX745   KC        KC66      1
  04/07/11 XY555   DP        DP45      2
  </pre>
  
  <p>And:</p>
  
  <pre>
  EMAILS
  
  DATE     USER_ID EMAIL_ID CLIENT_ID
  ________ _______ ________ _________
  04/05/11 AX745   EM001    CC
  04/05/11 AX745   EM005    BK
  04/07/11 XY555   EM008    DP
  </pre>
  
  <p>Both tables contain the client ID, and some form of date information, besides the user id.</p>
  
  <p>I also need to reference the client ID to get the actual client's name, and those are stored in yet a third table, like so:</p>
  
  <pre>
  CLIENTS
  
  CLIENT_ID CLIENT
  _________ ________________________
  CC        COCA-COLA
  KC        KFC
  DP        DOMINOS
  BK        BURGER KING
  </pre>
  
  <p>I need a query that will return, on a per date per user listing, how many impressions has the user had of each banner, as well as which client owns it, and how many e-mails was the user sent that particular day, and from which client.</p>
  
  <p>Something roughly like so:</p>
  
  <pre>
  DATE     USER_ID BANNER_CLIENT_ID BANNER_ID IMPRESSIONS EMAIL_ID EMAIL_CLIENT_ID
  ________ _______ ________________ _________ ___________ ________ _______________
  04/05/11 AX745   COCA-COLA        CC45      4           EM001    COCA-COLA
  04/05/11 AX745                                          EM005    BURGER-KING
  04/05/11 AX745   KFC              KC66      1
  04/07/11 XY555   DOMINOS          DP45      2           EM008    DOMINOS
  </pre>
  
  <p>I have no problem getting each set of information separately, but so far I haven't been able to merge all the data into a single report.</p>
  
  <p>Any help will be greatly appreciated.</p>
  
  <p>Thanks!</p>
  
  <p>C</p>