What are job ids for jobs that lasted more than 300 days?
select job_id from job_history where end_date - start_date > 300
Of these, which have been done more than once?
select job_id from job_history where end_date - start_date > 300 group by job_id having count(*) >= 2