I have a table that records shifts worked by employees. It's pretty simple, consisting of (reduced for simplicity): an auto-increment `primary key`, `employee_id`, `job_id`, `date`

A row is created for each shift worked, so if a particular employee doesn't work on a particular day, there will be no row for that employee for that date.

For a given day, I need to be able to return the number of consecutive days worked by each employee leading up to that day.

I have no idea where to start and would appreciate any help. Thanks