title: How to Join Two tables in HIVE.
body: <p>I have two tables A and B that both have the following structure.</p>
  
  <pre><code>// Table A
  
  Name    Age    actualdate    no
  
  // Table B
  
  City    sdate  edate         id
  </code></pre>
  
  <p>I wish to obtain all the fields from A and B using JOIN where, id = no and sdate &lt;= actualdate and edate >= actualdate.</p>
  
  <p>I tried as below using where clause, but it's not working.</p>
  
  <pre><code>select v3.*, t3.* from A v3
  JOIN
  B t3
  where v3.id = t3.no and
        v3.sdate &lt;= t3.actualdate and
        v3.edate &gt;= t3.actualdate
  limit 1;
  </code></pre>
  
  <p>Using On clause :</p>
  
  <pre><code>select v3.*, t3.* from A v3
      JOIN
      B t3
      ON ( v3.id = t3.no and
            v3.sdate &lt;= t3.actualdate and
            v3.edate &gt;= t3.actualdate )
      limit 1;
  </code></pre>
  
  <p>Unfortunately, Hive doesn't support equijoin. Is there a way to achieve the above using joins?</p>