I have been trying to get bureau name and count.

I have been trying to get bureau name and count.

show_graph_controller.rb

def index8
  @bureau=Incident.find(:all,:conditions=>"receipt_date LIKE
'2009-05%'",:select=>"distinct bureau_id,count
(*)",:group=>"bureau_id",:having=>"office_id=17")
end

index8.html.erb

<table>
<tr>
<th>Bureau name</th>
<th>Count</th>
<th>C</th>
<th>D</th>
</tr>
<tr>
<% @bureau.each do |incident| %>
<tr>
<td><%=h(Bureau.find(incident.bureau_id).name) %>台</td>
<td></td>
<td></td>
<td></td>
</tr>
<% end %>
</table>

How I can get count(*)?

I can get count(*) in SQL.

SELECT bureau_id,count(*) FROM incidents group by bureau_id having
office_id=17

Best regards,

Yoshida