title: Relational database join only showing one row
body: <p>I have the SQL Query:</p>
  
  <pre><code>SELECT B.branchNumber, B.buildingName, SUM(CASE WHEN PI.offerPrice &gt; 0 THEN PI.offerPrice * PI.quantity ELSE price * PI.quantity END) AS total
  FROM `purchase` 
  INNER JOIN `product` on purchase.productCode = product.productCode 
  INNER JOIN `branch` B on purchase.branchNumber = B.branchNumber 
  INNER JOIN `purchase info` PI on purchase.productCode = PI.productCode AND purchase.purchaseID = PI.purchaseID 
  </code></pre>
  
  <p>Which is returning only one <code>total</code> As the <code>INNER JOIN</code> only shows the matching columns with <code>total</code>.  When I remove the:</p>
  
  <pre><code>SUM(CASE WHEN PI.offerPrice &gt; 0 THEN PI.offerPrice * PI.quantity ELSE price * PI.quantity END) AS total
  </code></pre>
  
  <p>It returns several rows. How can I get this to return all the rows with the <code>total</code>s?</p>