title: Oracle SQL: Counting in 4h?
body: <p>I have oracle 10g database with table of many records.
  Table has data for employees receiving some kind of orders.
  Most usable columns are employee, dt and orderId (I've attached example).
  I want to construct select that will select records of an employee that had 6 or more orders in <strong>any</strong> 4h. I used regular join, various functions but I still didn't made usable select.
  I couldn't make select that will for each record search in past(4h) and see if there are 6 orders for same employee.</p>
  
  <p>Any help or solution is appreciated.</p>
  
  <p>BR,</p>
  
  <p>IJ</p>
  
  <p><a href="http://sqlfiddle.com/#!2/77418/1" rel="nofollow">http://sqlfiddle.com/#!2/77418/1</a></p>
  
  <p>Output of select should be:</p>
  
  <p>Joe 19.2.2013 13:28:09  36589589</p>
  
  <p>Joe 19.2.2013 13:50:59  36589593</p>
  
  <p>Matt    19.2.2013 13:57:02  36589594</p>
  
  <p>Joe 19.2.2013 14:19:46  36589598</p>
  
  <p>Benny   19.2.2013 14:50:28  36589601</p>
  
  <p>Benny   19.2.2013 14:54:58  36589602</p>
  
  <p>Benny   19.2.2013 14:56:35  36589603</p>
  
  <p>Ray 19.2.2013 15:26:39  36589607</p>
  
  <p>Ray 19.2.2013 15:26:41  36589608</p>
  
  <p>Ray 19.2.2013 15:26:44  36589609</p>
  
  <p>Ray 19.2.2013 15:48:11  36589611</p>
  
  <p>Benny   19.2.2013 16:48:52  36589614</p>
  
  <p>Benny   19.2.2013 16:49:40  36589615</p>
  
  <p>Benny   19.2.2013 16:50:38  36589616</p>
  
  <p>Johnny  19.2.2013 17:37:33  36589620</p>
  
  <p>Johnny  19.2.2013 17:51:41  36589621</p>
  
  <p>Joe 19.2.2013 18:16:55  36589625</p>
  
  <p>Johnny  19.2.2013 18:34:14  36589626</p>
  
  <p>Matt    19.2.2013 21:13:50  36589632</p>