title: Oracle select to find occurences of couple of status
body: <p>I have the following data:</p>
  
  <pre>
  STATUS                      DATE                        TIME                        
  B                           20181011                    13:28:27                    
  B                           20181011                    13:36:05                    
  B                           20181011                    15:28:40                    
  I                           20181011                    15:28:57                    
  I                           20181011                    15:41:56                    
  I                           20181018                    08:21:43                    
  B                           20181018                    13:38:00                    
  I                           20181019                    17:03:00                    
  B                           20181023                    09:45:54                    
  I                           20181023                    10:35:44                    
  I                           20181023                    10:38:11                    
  </pre>
  
  <p>Every time I have a sequence of STATUS 'B', I must use the last, the same for STATUS 'I' so I can get every couple of this status considering the rule above and calculate the time between them. I tried some selects without success also I couldn't find any questions like mine.</p>
  
  <p>edit:
  I would like the select could make the result below:</p>
  
  <pre>
  STATUS                      DATE                        TIME                        
  B                           20181011                    15:28:40                    
  I                           20181018                    08:21:43                    
  B                           20181018                    13:38:00                    
  I                           20181019                    17:03:00                    
  B                           20181023                    09:45:54                    
  I                           20181023                    10:38:11                    
  </pre>