Postgresql – How to get previous record by date in case of no match in a join condition
I have two tables: dates: date 2024-01-01 2024-01-02 2024-01-03 2024-01-04 2024-01-05 actual: business_date id 2024-01-01 1 2024-01-02 2 2024-01-04 4 2024-01-05 5 I want to join these tables on the condition date = business_date, but in the case where there's…