SQL – Identify a record's status based on dates from another table (postgresql)
I have the following table called worker_log: log_date total_workers store 2021-01-01 2 Ralphs 2021-02-01 0 Ralphs 2021-03-01 3 Ralphs 2021-01-01 3 Benny's 2021-02-01 0 Benny's 2021-03-01 1 Benny's For Ralphs, from 1/1/21 to 1/31/21, there were 2 total workers. From…