title: Mysql sql query to format a report
body: <p>This is my table <strong><code>product_details</code></strong>: </p>
  
  <pre><code>Product_Code | Size | Quantity
  -------------+------+-----------
  CS01         | 10   | 15
  CS01         | 11   | 25
  CS01         | 12   | 35
  PR01         | 40   | 50
  PR01         | 41   | 60
  </code></pre>
  
  <p>I want a the following format for a report to get the total quantity group by product code (all sizes of product code): </p>
  
  <pre><code>Product_Code | Size       | Quantity
  -------------+------------+----------------
  CS01         | 10  11  12 | 75
  PR01         | 40  41     | 110 
  </code></pre>
  
  <p>I tried the following query but it does not give the result I want.</p>
  
  <pre><code>SELECT product_no, size, SUM(quantity) 
  FROM product_details 
  GROUP BY product_no;
  </code></pre>
  
  <p>Please help me to find the query to format the report.</p>