title: Date difference between two records in same table
body: <p>I have a table (<code>job_logs</code>) with the following records:
  <code>id</code>, <code>job_id</code>, <code>user_id</code>, <code>status</code>, <code>created_at</code>, <code>job_type</code>.</p>
  
  <p>Each time a job starts to run a record is written in the <code>job_log</code> table with <code>status='started'</code>. When a job finish running another record is added to the table with <code>status='completed'</code>.</p>
  
  <p>Both records has the same <code>user_id</code>, <code>job_type</code> and <strong>job_id</strong> (which is determined by the process running the job - unique to these 2 records).</p>
  
  <p>I want a query that will return all these records pairs in the table (ordered by id desc) but the tricky part is that I want to add to the record with the 'completed' status the time it took the job to run (<code>completed.created_at - started.created_at</code>).</p>
  
  <p>How can I do that?</p>