title: LEFT JOIN - Return empty results with left join for sum of payment_method
body: <p>This is my first question on stackoverflow so I try my best to not screw up. I am scratching my head on this query for a couple of hours and can't make any progress. </p>
  
  <p>I use a view which has several bookings in it. All those bookings have a payment_method e.g. paypal or creditcard.</p>
  
  <pre><code>Customer Name | Price | payment_method
  John Doe      |  20   |  creditcard
  Susan Soe     |  10   |  paypal
  </code></pre>
  
  <p>With my sql query I am trying to get the sums for all payment_methods. Unfortunately payment_methods which were not used this month don't show up. </p>
  
  <p>So I created an additional table called PaymentMethods with the column Methods. </p>
  
  <pre><code>Methods
  creditcard
  premium
  sofort
  bank
  paypal
  </code></pre>
  
  <p>I then tried to use a <code>LEFT JOIN</code> to get a result like this:</p>
  
  <pre><code>payment_method  | TotalQuantity (-&gt;sum(price))
  creditcard      | 20
  premium         | 0
  sofort          | 0
  bank            | 0
  paypal          | 10
  </code></pre>
  
  <p>But instead I only get those sums returned which have a payment_method used that month already. </p>
  
  <pre><code>payment_method  | TotalQuantity (-&gt; sum(price))
  creditcard      | 20
  paypal          | 10
  </code></pre>
  
  <p>This is my statement. I would really appreciate some input on what I do wrong here. </p>
  
  <pre><code>SELECT payment_method, SUM(IFNULL(price,0)) AS TotalQuantity 
  FROM PaymentMethods 
  LEFT JOIN PaymentMethods
  ON SlotBookingsFullView.payment_method=PaymentMethods.Methods
  WHERE (booking_date BETWEEN '2018-07-01 00:00:00' AND '2018-07-30 23:59:59') 
  </code></pre>
  
  <p><strong>* EDIT *</strong>
  m0lochwalker pointed out that I should use <code>GROUP BY</code> clause...I had it but it got during copy&amp;paste action. Here it is. </p>
  
  <pre><code>GROUP BY PaymentMethods.Methods ORDER BY PaymentMethods.Methods DESC
  </code></pre>