title: How do I select customers where their first three orders match certain values?
body: <p>Say I have a table shop_orders, and I want to look up all of the customer_id where their first 3 order_type are "Book", "Coffee" and "Pen" in that order.</p>
  
  <p>Source table would look like this:</p>
  
  <pre><code>customer_id  order_type  order_time
  6872         Coffee      2018-04-06 15:06
  6455         Book        2018-04-06 15:08
  6872         Coffee      2018-04-06 19:12
  6455         Coffee      2018-04-07 15:08
  5217         Pen         2018-04-08 09:11
  5217         Book        2018-04-08 10:55
  6455         Pen         2018-04-09 05:22
  6455         Coffee      2018-04-09 07:46
  </code></pre>
  
  <p>As user 6455's first three orders are "Book", "Coffee", and "Pen", the query should return:</p>
  
  <pre><code>customer_id
  6455
  </code></pre>
  
  <p>I am using BigQuery for this.</p>