select int_id, street1, street2, count(int_id) as crashes ;
, SUM( IIF(INJURY_SEV=1, 1, 0) ) AS sev1 ;
...
, SUM( IIF(INJURY_SEV=6, 1, 0) ) AS sev6 ;
>I am still trying to get the SQL group by clause down. Can someone help me with this?
>The table contains a record for each accident at intersections in the city. Fields are an intersection identifier INT_ID, the 2 cross streets STREET1 and STREET2, injury severity INJURY_SEV coded 1 through 6. I want to obtain 1 record per intersection containing the total number of crashes at the intersection plus the total number for each of the 6 severity codes. This works for the total but I can't figure out how to add the six severity codes.
>
>
>select int_id, street1, street2, count(int_id) as crashes;
> from crash1 ;
> group by int_id, street1, street2 ;
> order by crashes desc, int_id
>
>
>Thanks
--sb--