Displaying 1 result from an estimated 1 matches for "original_at".
2006 Apr 11
2
Getting distinct years from a date column the Rails way
I have an original_at column in my photos table. I''d like to get a list
of distinct years that occur in this column, and some of the values are
NULL. I see two ways of doing this. The SQLish way:
photos = Photo.find :all, :select => ''distinct year(original_at)''
This is efficient in th...