title: Split a table from a query to many tables (with "DISTINCT")
body: <p><strong>Query</strong></p>
  
  <pre><code>SELECT DISTINCT code, hour(datetime), sum(price)
  FROM something
  ORDER BY code;
  </code></pre>
  
  <p>I have one result table with 3 columns  <code>code</code>, <code>hour</code>, <code>sum</code>.</p>
  
  <p>I would like to have as many tables as there are different <code>code</code>.</p>
  
  <p>a code = a table and each table containing "code" (which will be the same in the table), "hour" and "sum".</p>
  
  <p>Thank you.</p>
  
  <p><strong>Edit 1 :</strong></p>
  
  <p>Thank you for each replies.
  I don't want to UNION tables, not at all.</p>
  
  <p>@Gordon Linoff : I forgot to say that it's for analytics db (Infinidb) so I know that it's not the right way for a relational DB.</p>
  
  <p>I would like to do this to avoid to have many queries. (one query is more faster than many queries)</p>
  
  <p>What I have :</p>
  
  <p><img src="https://i.stack.imgur.com/Dcx24.jpg" alt="enter image description here"></p>
  
  <p>What I want : (there is not every tables, just to show)</p>
  
  <p><img src="https://i.stack.imgur.com/41J77.jpg" alt="enter image description here"></p>