SQL count how many times record has appeared before
<p>I have a table containing <code>report_date</code> and <code>job_no</code> columns and would like to know how to return a column that shows how many times the <code>job_no</code> has appeared before the current occurrence.</p>

<p>I have tried count(job_no) but I do not know how to set this to only count occurrences before the current report_date.</p>

<p>So far, I have had to make do with exporting the data into excel and performing a countifs for report date &lt; current report_date and job_no = current job_no but this is too clunky.</p>

<p>Please help! :)</p>