title: select rows with users' own time range
body: <p>I would like to select rows based on users' own time range.</p>
  
  <p>Suppose I have two tables. The first one is about the user activity log data.</p>
  
  <pre><code>| user_id    | date        | activity     |
  |:-----------|------------:|:------------:|
  | 1          |      1/1/18 |    a1        |
  | 1          |     2/12/18 |    a2        |
  | 1          |     3/21/18 |    a3        |
  | 2          |     1/13/18 |    b1        |
  | 2          |      2/4/18 |    b2        |
  | 2          |     3/24/18 |    b3        |
  </code></pre>
  
  <p>The second table is the time range I want to extract for each user
  user_id, start_date, end_date</p>
  
  <pre><code>1, 1/1/18, 3/1/18
  2, 2/1/18, 4/1/18
  </code></pre>
  
  <p>The expected result would be
  user_id, date, activity</p>
  
  <pre><code>1, 1/1/18, a1
  1, 2/12/18, a2
  2, 2/4/18, b2
  2, 3/24/18, b3
  </code></pre>