title: SQL query: Join two tables with where clause
body: <p>I have a problem with a SQL query. I got the following query working, which pretty basic:</p>
  
  <pre><code>SELECT *
  FROM table1
  WHERE Date = CURDATE()
  </code></pre>
  
  <p>There's a column in table1 which is called <code>h_id</code> and a <code>table2</code> with the columns <code>h_id</code> and <code>name</code></p>
  
  <p>I want to join those two tables so that I have the names out of table 2 from the current date.</p>
  
  <p>I tried this, but it doesn't seem to work</p>
  
  <pre><code>SELECT t2.name, t1.field2
  FROM table1 t1
  INNER JOIN table2 t2 ON t1.H_ID = t2.H_ID
  WHERE t1.Date = CURDATE( )
  </code></pre>