Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

John http://www.red91.com

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

record grouping

   1  
   2  @users = User.find(
   3    :all, 
   4    :select => "MONTH(created_at) as month, YEAR(created_at) as year, COUNT(*) AS records",
   5    :conditions => ["admin = 0'"], 
   6    :group => "year, month")
   7  
   8  <% for @user in @users %>
   9    <%=@user.month%>
  10    <%=@user.year%>
  11    <%=@user.records%>
  12  <% end %>

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS