I'm new to MySQL and I'm having trouble with the problem below;

Let's call this table `runners_table` 

```
+---------+-----------+
| race_id | runner_id | 
+---------+-----------+
|    10   |  A        |   
|    10   |  E        | 
|    10   |  V        | 
|    23   |  G        | 
|    23   |  J        |  
|    23   |  A        | 
|    67   |  E        | 
|    67   |  G        | 
|    67   |  X        | 
+---------+-----------+

```

And I want to add a new column like this;

```
+---------+-----------+--------------+
| race_id | runner_id | prev_race_id | 
+---------+-----------+--------------+
|    10   |  A        | -            |
|    10   |  E        | -            |
|    10   |  V        | -            |
|    23   |  G        | -            | 
|    23   |  J        | -            | 
|    23   |  A        | 10           | 
|    67   |  E        | 10           |
|    67   |  G        | 23           | 
|    67   |  X        | -            | 
+---------+-----------+--------------+

```

Where `prev_race_id` looks back and gets the previous `race_id` for the same `runner_id`.

To illustrate;
What I'd like to do is, say a runner took part in 6 races out of 10 races that year, in the row relating to his 5th race I want to know the race\_id of his 4th race.

I guess I could make a new table for every runner that was a record of the races they took part in, but this would stretch to hundreds of tables... there must be a better way.

Is it possible to do this?