title: Joining two Athena tables with two where clauses
body: <p>I have two Athena tables with the following queries:</p>
  
  <pre><code>select 
    date,
    uid,
    logged_hrs,
    extract(hour from start_time) as hour
  from schema.table1
  where building = 'MKE'
    and pt_date between date '2019-01-01' and date '2019-01-09'
  </code></pre>
  
  <p>and </p>
  
  <pre><code>select 
      associate_uid as uid,
      date(substr(fcdate_utc, 1, 10)) as pt_date,
      learning_curve_level
    from tenure.learningcurve 
    where warehouse_id = 'MKE'
      and date(substr(fcdate_utc, 1, 10)) between date '2019-01-01' and date '2019-01-09'
  </code></pre>
  
  <p>I want to join them on <code>uid</code> and <code>pt_date</code>. How can I do that? </p>
  
  <p>I tried:</p>
  
  <pre><code>select (select 
        date,
        uid,
        logged_hrs,
        extract(hour from start_time) as hour
      from schema.table1
      where building = 'MKE'
        and pt_date between date '2019-01-01' and date '2019-01-09') as a
  left join (select 
          associate_uid as uid,
          date(substr(fcdate_utc, 1, 10)) as pt_date,
          learning_curve_level
        from tenure.learningcurve 
        where warehouse_id = 'MKE'
          and date(substr(fcdate_utc, 1, 10)) between date '2019-01-01' and date '2019-01-09'
  ) as b 
  on a.uid=b.uid and a.pt_date = b.pt_date
  </code></pre>
  
  <p>But the above results in the error <code>mismatched input 'left' expecting {&lt;eof&gt;, ',', 'from', 'where', 'group', 'order', 'having', 'limit', 'union', 'except', 'intersect'}</code></p>