title: Hierarchial SQL Query in Oracle
body: <p>I have a question that I'm hoping you can help with. I've been trying to think of a way to display data in a manner that I'm looking for, without much success. Basically, the data is laid out as follows:</p>
  
  <p>example of data:</p>
  
  <pre>
  
  UID | Name | Action | Parent_UID | Date         |  Category    |    Item
  1   | John | Delete | (null)     | 10-DEC-2013  |    Cars      |    Cars
  2   | John | Delete | 1          | 10-DEC-2013  |    Cars      |    Ford
  3   | Mark | Add    | (null)     | 09-DEC-2013  |    Cars      |    Tesla
  4   | Mark | Add    | 3          | 09-DEC-2013  |    Model     |    Model-S
  5   | Mark | Add    | 4          | 09-DEC-2013  |   Inventory  |      5
  </pre>
  
  <p>The table contains parent records, as well as child records recording actions taken. The Parent records have a Parent_UID of null. There are many records in this table, and they aren't organized in any fashion by default. As you can see, the table can get very deep in terms of the layers of data.</p>
  
  <p>What I would like to do is have the parent record first, followed by the child record.</p>
  
  <p>I tried the following SQL in our Oracle database:</p>
  
  <p><code>
  select *
  from  Table 
  where Date > '09-DEC-2013'
  and Name = 'John'
  start with parent_uid is null
  connect by parent_uid = uid;
  </code></p>
  
  <p>but it's taking forever to run and I'm not sure if the syntax is correct. Is there a better way to get what I'm looking for?</p>