Postgresql – Most recent status of each item as of the 1st of each month
I have a table that is structured in the following way: fiddle create table test(id,status,datechange)as values ('011AVN', 11, '2024-06-21 08:27:13'::timestamp) ,('011AVN', 12, '2024-06-21 08:28:16') ,('011AVN', 21, '2024-07-04 15:01:21') ,('011AVN', 22, '2024-07-07 20:30:30') ,('011AVN', 31, '2024-07-11 17:38:01') ,('011AVN', 32, '2024-07-12 20:30:15')…