title: Sum price from products to order
body: <p>I want to order my orders with the total price that it gets from products table. And show the customer details with it. This is how my tables look like:</p>
  <p>Orders table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>order_id</th>
  <th>customer_id</th>
  <th>date_order_placed</th>
  <th>status</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>20001</td>
  <td>1</td>
  <td>2022-03-11</td>
  <td>Unpaid</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>order products table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>product_order_id</th>
  <th>order_id</th>
  <th>product_id</th>
  <th>quantity</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>20001</td>
  <td>1</td>
  <td>1</td>
  </tr>
  <tr>
  <td>2</td>
  <td>20001</td>
  <td>2</td>
  <td>1</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Products table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>product_id</th>
  <th>name</th>
  <th>description</th>
  <th>price</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>Apple</td>
  <td>This is an apple</td>
  <td>15</td>
  </tr>
  <tr>
  <td>2</td>
  <td>Pear</td>
  <td>This is a pear</td>
  <td>30</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>Customers table</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>customer_id</th>
  <th>first_name</th>
  <th>last_name</th>
  <th>email</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>1</td>
  <td>John</td>
  <td>Doe</td>
  <td>johndoe@email.com</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>This is my SQL I tried</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT * 
  FROM orders 
  LEFT JOIN orders_products USING (order_id) 
  LEFT JOIN products USING (product_id) 
  LEFT JOIN customers USING (customer_id) 
  WHERE order_id = 20001 
  ORDER BY order_id DESC
  </code></pre>
  <p>The result I get is this and what I want I also described in the snippet</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-css lang-css prettyprint-override"><code>#customers {
    font-family: Arial, Helvetica, sans-serif;
    border-collapse: collapse;
    width: 100%;
  }
  
  #customers td, #customers th {
    border: 1px solid #ddd;
    padding: 8px;
  }
  
  #customers tr:nth-child(even){background-color: #f2f2f2;}
  
  #customers tr:hover {background-color: #ddd;}
  
  #customers th {
    padding-top: 12px;
    padding-bottom: 12px;
    text-align: left;
    background-color: #04AA6D;
    color: white;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--- CSS BY W3schools --&gt;
  &lt;h3&gt;Result i get&lt;/h3&gt;
  &lt;table id="customers"&gt;
    &lt;tr&gt;
      &lt;th&gt;Order id&lt;/th&gt;
      &lt;th&gt;Date placed&lt;/th&gt;
      &lt;th&gt;Customer&lt;/th&gt;
      &lt;th&gt;Total price&lt;/th&gt;
      &lt;th&gt;Status&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;20001&lt;/td&gt;
      &lt;td&gt;2022-03-11&lt;/td&gt;
      &lt;td&gt;John Doe&lt;/td&gt;
      &lt;td&gt;&amp;euro;15&lt;/td&gt;
      &lt;td&gt;Unpaid&lt;/td&gt;
    &lt;/tr&gt;
      &lt;tr&gt;
      &lt;td&gt;20001&lt;/td&gt;
      &lt;td&gt;2022-03-11&lt;/td&gt;
      &lt;td&gt;John Doe&lt;/td&gt;
      &lt;td&gt;&amp;euro;30&lt;/td&gt;
      &lt;td&gt;Unpaid&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;
  
  &lt;h3&gt;Result i want&lt;/h3&gt;
  &lt;table id="customers"&gt;
    &lt;tr&gt;
      &lt;th&gt;Order id&lt;/th&gt;
      &lt;th&gt;Date placed&lt;/th&gt;
      &lt;th&gt;Customer&lt;/th&gt;
      &lt;th&gt;Total price&lt;/th&gt;
      &lt;th&gt;Status&lt;/th&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
      &lt;td&gt;20001&lt;/td&gt;
      &lt;td&gt;2022-03-11&lt;/td&gt;
      &lt;td&gt;John Doe&lt;/td&gt;
      &lt;td&gt;&amp;euro;45&lt;/td&gt;
      &lt;td&gt;Unpaid&lt;/td&gt;
    &lt;/tr&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>So instead that the orders with the same order id are invidual i want to add the prices of the same order and make it one total price i already tried this</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT * 
  FROM orders
  LEFT JOIN orders_products USING (order_id) 
  LEFT JOIN products sum(price) as total_price USING (product_id) 
  LEFT JOIN customers USING (customer_id) 
  WHERE order_id &gt; ? 
  ORDER BY order_id DESC
  </code></pre>
  <p>but with no success</p>