Hey,
I'm writing a php application that works with dates:
I have a table that stores information about events, including the date the event takes place. I need to summarize how many different years exist within the records of this table so that I can loop the year and create recordsets based on year.
So if:
event 1: 2008
event 2: 2008
event 3: 2007
event 4: 2006
event 5: 2006
I need to be able to summarize that there are only 3 different years out of 5 records, then create an array of those years, after which I can loop the array of years and, well, do other stuff with events based on their year.
Is there an sql method to summarize unique values in this way?
Thanks!