title: Bigquery Join syntax errors with example code that works in standard SQL
body: <p>I am using big query and looking to find the toalAfterRefund value of the first order of an emailAddress.
  Both these select statements work as individual statements, but I'm having trouble joining them.
  I get the error</p>
  <pre><code>Syntax error: Expected end of input but got keyword JOIN at [1:1]
  </code></pre>
  <p>I'm having trouble understanding what I need to do to join these as these statements together in bigquery.
  I am trying to get the toalAfterRefund value of the emailAddresses first orderDate.</p>
  <pre><code>SELECT  H.emailAddress, H.orderId, H.orderDate, H.totalAfterRefund
             FROM  `nexgen-362616.orders.allOrders` AS H
            WHERE   totalAfterRefund&gt;0 
            
  JOIN
            (SELECT emailAddress, MIN(OrderDate) AS first_order
            FROM  `nexgen-362616.orders.allOrders` as X
            WHERE   totalAfterRefund&gt;0 
            GROUP BY emailAddress) 
            ON H.emailAddress = X.emailAddress AND H.orderDate = X.first_order
  </code></pre>