title: Oracle Grouping
body: <p>I want to be able to do is sum up the time for each "episode" of time the ID is with one group and than get the first episode time for NC to C and C to NC and also the last episode time from NC to C and C to NC In the table below I manually added the <code>GRP_Time</code> column. Also I have added the end result table</p>
  
  <p>This is the metric I'm trying to generate systematically.</p>
  
  <pre class="lang-none prettyprint-override"><code>ID    ASSign_ID  GRP      Time            GRP_Time   
  11    1788       NC       6             
  11    1802       NC       1               7
  11    2995       C        7               7
  11    5496       NC       11              11
  11    6077       C        2 
  11    6216       C        2
  11    6226       C        4               8  
  11    6790       NC       5               5
  12    1234       C        6               6
  12    2345       NC       1               
  12    3456       NC       8               9
  12    4567       C       11              11
  14    6789       C        2 
  14    7890       C        2
  14    8900       C        4               8  
  14    8904       NC       5               5
  </code></pre>
  
  <p>Result Table</p>
  
  <pre class="lang-none prettyprint-override"><code>ID   First_ET_NC_C    First_ET_C_NC   LAST_ET_NC_C   LAST_ET_C_NC
  11   7                7               11             8
  12   9                6                9             6 
  14   -                8                -             8
  </code></pre>