title: how to make a select query on all weekdays/ all month / all hours and showing 0 when values don't exist
body: <p>In sql I want to show statistics data, so I'd like to show sums from all weekdays, by showing 0 for the weekday that doesn't exist. Same goes with month, hours, years....</p>
  
  <p>The problem is that there is no table to join to to get the missing days.<br>
  Is there a clean method to do this?</p>
  
  <p>Thank you</p>
  
  <p><strong>Edit</strong> : 
  The DB and data is irrelevent but I'm using Oracle DB and Mysql, simply put if i want to do </p>
  
  <pre><code>SELECT SUM(SALES) FROM SALES_TABLE WHERE SALES_DATE BETWEEN DATE1 AND DATE2 GROUP BY WEEKDAY
  </code></pre>
  
  <p>how to change this to get 0 for example on sundays, and not get SATURDAY :4, MONDAY:4</p>