title: How to query the two related transactions in different days
body: <p>If i have table consists of two columns one for the user id and the other for the finger print(attendance,leave) how to detect all the users whose (leave time ) in the next day of their first finger print?</p>
  
  <pre><code>USERID  CHECKTIME
  2982    2015-03-11 09:08:10.000
  2982    2015-03-11 20:13:57.000
  2982    2015-03-12 08:43:35.000
  2982    2015-03-13 04:54:57.000
  2982    2015-03-13 05:01:03.000
  2982    2015-03-13 19:24:11.000
  2982    2015-03-14 10:28:26.000
  2982    2015-03-15 04:55:03.000
  2982    2015-03-15 05:01:24.000
  </code></pre>
  
  <p>Example : this user has a check in <code>2015-03-12</code> in <code>08:43:35.000</code> 
  and its check out in the next day  <code>2015-03-13</code> in <code>04:54:57.000</code> </p>
  
  <p>i want to query all the users who has cases like that considering the user may have more than two check-in-out in the same day so i want just the first and (the last in the next day)</p>