I am trying to come up with a fast query that will select the last entry in a table for every month.
I have an entry for every day over a period of several years and I want to see the last entry for each month over that time span. I am using postgresql on the server. I can create a function that given a date will return the last day of the month but applying that function to the query makes the query run very slowly.
I have an entry for every day over a period of several years and I want to see the last entry for each month over that time span. I am using postgresql on the server. I can create a function that given a date will return the last day of the month but applying that function to the query makes the query run very slowly.