title: sql - compare two tables
body: <p>I have two tables, <code>table1</code> and <code>table2</code>. They both have same columns, <code>program_id</code>, <code>scheduled_time</code> and <code>timezone_id</code>. </p>
  
  <p>I want to retrieve the rows whose have same <code>program_id</code> and <code>timezone_id</code>, but have different <code>scheduled_time</code> from <code>table1</code>. </p>
  
  <p>So here is the sql that I tried:</p>
  
  <pre><code>select t1.* 
  from table1 t1, table2 t2 
  where t1.program_id = t2.program_id 
    and t1.timezone_id = t2.timezone_id 
    and t1.scheduled_time != t2.scheduled_time;
  </code></pre>
  
  <p>But I still see rows that have same <code>program_id</code>, <code>scheduled_time</code> and <code>timezone_id</code>. </p>
  
  <p>Could someone fix the sql?</p>
  
  <p>Thanks.</p>