title: Oracle SQL Cross Tab Query
body: <p>I have a table which has the following structure and sample data:</p>
  
  <pre><code>ITEM   LOC   STOCK
  0001   KS5    10
  0001   KS6    30
  0002   KS5    10
  0002   KS6    20
  </code></pre>
  
  <p>I need to query cross tab so that I get </p>
  
  <pre><code>ITEM  KS5  KS6
  0001  10   30
  0002  10   20
  </code></pre>
  
  <p>The LOC (KS5 and KS6) can vary and new locations can be added.</p>
  
  <p>How can I get the desired result?</p>