title: Fetching several values from the same column in a table
body: <p>I have 2 tables. One that lists all objects (object) and one that contains the hierarchy for the objects (hierarchy).</p>
  
  <pre><code>Object table:
  ID   | Description | ClassID
  ------------------------------
  0001 | Room 1A     | 1000
  0002 | Floor 1     | 1001
  0003 | Room 1B     | 1000
  0004 | Building 01 | 1002
  </code></pre>
  
  <p>Where classID specifies the type of object (room=1000, floor=1001 or building=1002)</p>
  
  <pre><code>Hierarchy table:
  RelationID | parentid | child ID | level
  1          | 0004     | 0002     |   1
  2          | 0004     | 0001     |   2
  3          | 0002     | 0001     |   1
  </code></pre>
  
  <p>Where level specifies the hierarchical level of the child. E.g. if I'm searching all buildings then (1 --> child (floor) , 2--> grandchild (room)).</p>
  
  <p>So I would like to fetch the description from the object table for all the rooms, the floor and the building they are in.</p>
  
  <p>E.g.</p>
  
  <pre><code>Room | Floor | Bldg
  -------------------
  1A   |   1   |  01
  1B   |   1   |  01
  2A   |   2   |  01
  2B   |   2   |  01
  1A   |   1   |  02
  </code></pre>
  
  <p>etc.
  How can I go about doing this?</p>