I have a table like the following
| name | birthdate |
|---|---|
| John | 1980-10-25 |
| Mike | 1975-09-17 |
| Jill | 1987-01-13 |
| Anne | 1999-02-01 |
Today's date is 2022-02-22.
How would I write a sql query that returns the name and last time their birthday occurred? As in the same day and month from 2022 if their birthday has already happened this year or from 2021 if their birthday hasn't happened this year
Sample response would be
| name | last_birthdate |
|---|---|
| John | 2022-10-25 |
| Mike | 2022-09-17 |
| Jill | 2021-01-13 |
| Anne | 2021-02-01 |