Possible duplicate:
Rails: select unique values ββfrom a column
Let's say I have 5,000 records that were created in the last two years (2011 and 2012). How can I iterate over all these records and return an array of only unique years [2011, 2012]?
I create a report in which rows are labeled every year, which writes exit and columns are labeled for months. Then td is filled with amounts for each month of each year.
source share