Subject Re: Summary SQL question
Author diwic2
> SELECT
> uskid,
> COUNT(CASE WHEN fm=2 THEN 1 END),
> COUNT(CASE WHEN fm=3 THEN 1 END),
> COUNT(CASE WHEN fm=4 THEN 1 END),
> COUNT(CASE WHEN fm2=2 THEN 1 END),
> COUNT(CASE WHEN fm2=3 THEN 1 END),
> COUNT(CASE WHEN fm2=4 THEN 1 END)
> FROM T
> GROUP BY uskid;
>
> (B should be faster, since it requires only one pass)
>

Thanks a lot for your help!

// David