title: SQL Select Query Error
body: <p>Here I have have a table </p>
  
  <blockquote>
    <p>expenses</p>
  </blockquote>
  
  <p>with columns </p>
  
  <ul>
  <li>id (PK)</li>
  <li>type_id (FK)</li>
  <li>amount</li>
  <li>date</li>
  <li>vehicle_id (FK)</li>
  </ul>
  
  <p>In my <em>jtable</em> I want to show it like this <a href="https://i.stack.imgur.com/xtbRq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xtbRq.png" alt="enter image description here"></a></p>
  
  <p>I used this sql code the</p>
  
  <p><code>SELECT vehicle_id,SUM(amount) FROM expenses GROUP BY type_id;</code></p>
  
  <p>And I got output as</p>
  
  <p><a href="https://i.stack.imgur.com/Y5Dhl.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y5Dhl.png" alt="enter image description here"></a></p>
  
  <p>But I want it like previous image (the long one).. What can I do to this ? </p>
  
  <p><strong>Note</strong></p>
  
  <p>Here I used <em>Sum</em> for get multiple <em>amount</em> values.<em>type_id</em> used to denote various expenses type like diesel, oil, service..</p>