I have database that tracked person salary over time like table below:
I want to query the person (based on id) salary each month to give output like the table below

I don't know what query to use since it needs to iterate in the salary database to check what is the valid salary for certain date. Any idea for this?
Thanks!
