title: Pivoting Oracle query
body: <p>I have the following tables:</p>
  
  <pre><code>Items
  ______
  Item_ID
  Item_Name
  ...
  
  
  Properties
  ___________
  Item_ID
  Property_ID
  Property_Value_ID
  
  PropertyTypes
  _______________
  Property_Type_ID
  Property_Type_Name
  
  
  PropertyValues
  _______________
  Property_Type_ID
  Value_ID
  Value_Name
  </code></pre>
  
  <p>and a query</p>
  
  <pre><code>SELECT pt.PROPERTY_TYPE_NAME, pv.VALUE_NAME
  FROM Property_Types pt, PropertyValues pv, Properties p
  WHERE pt.PROPERTY_TYPE_ID = pv.PROPERTY_TYPE_ID
  AND pv.VALUE_ID = p.PROPERTY_VALUE_ID
  AND p.ITEM_ID = 1;
  </code></pre>
  
  <p>That gives me 3 rows for each of the three properties but what I want is one row where PROPERTY_TYPE_NAME is a column name and PROPERTY_VALUE as a column value</p>
  
  <p>what I have is</p>
  
  <pre><code> Column1|Column2 |Column3| Column4|Column5| Column6
   Type1  | Value1 | Type2 | Value2 | Type3 | Value3
  </code></pre>
  
  <p>what I need is</p>
  
  <pre><code>Type1  | Type2 | Type3
  Value1 | Value2| Value3
  </code></pre>