title: How to present the results from mySQL from rows to columns?
body: <p>I have a table that contains a lot of rows for the same ids. For example if I query the following in mySQL:</p>
  
  <pre><code>......WHERE ID=10 OR ID = 11 OR ID=38 OR ID=49....
  </code></pre>
  
  <p>I will get the result like below</p>
  
  <pre><code>id ---- visits ---- turnover ---- cost
  10 ---- 20 ------- 10.000 ---- 500
  11 ---- 43 ------ 190 ----- 200
  and so on...
  </code></pre>
  
  <p>My question is how can I present the table in a way like this:</p>
  
  <pre><code>            id ------ id ----- id
              10 ------ 11 ------ *****
  visits      20------- 43 ------ *****
  turnover    10.000 --- 190 ---- *****
  cost        500 ----- 200 ------- ****
  </code></pre>
  
  <p><strong>my query. the above example is only for example purposes</strong></p>
  
  <pre><code>jdbcDriver &lt;- JDBC(driverClass="oracle.jdbc.OracleDriver", classPath="lib/ojdbc6.jar")
  jdbcConnection &lt;- dbConnect(jdbcDriver, "jdbc:oracle:thin:@//database.hostname.com:port/service_name_or_sid", "username", "password")
  MyData &lt;- dbGetQuery(jdbcConnection,"SELECT VALUE,DATA_POINT_DATE
  FROM HD.HD_SE_HAM 
  WHERE TE_ID = 02342
  and end_date = to_date('31/12/9999', 'dd/mm/yyyy')
  and DATA_SKATA_DATE  Between '01-Jan-10 ' and  '30-Jun-13'
  order by data_skata_date asc")
  </code></pre>