title: How to calculate time difference in MYSQL
body: <p>I have Rails application which using MYSQL as database. For some condition, I have to delete all the records from table which was stored exactly 2 hours before the current time. </p>
  
  <p>My query is :</p>
  
  <pre><code>DELETE FROM TABLE_NAME WHERE (NOW() - created_at) &gt; 7200;
  </code></pre>
  
  <p>Here create_at is datetime column type. Storing the value in the format "2012-12-04 06:39:44" </p>
  
  <p>My problem is, the above query fetch the records even though the record created time is just 40 to 50 minutes and got deleted.  The only problem is the record got delete after it reach 40 to 50 minx from it create time.</p>
  
  <p>Can any one please correct my query. I want the MySQL solution. Please help me</p>