select SchedLine.Length, Details.Type; from SchedLine join detail on SchedLine.SchedLineId = Details.SchedLineId>I have 2 tables:
>
> Length Type
> ----------------------
> 30 1
> 30 2
> 30 3
> .
> .
> .
> 30 16
> 60 1
> 60 2
> 60 3
> .
> .
> .
>
>
>and so on.
>
>Each record in the result set should contain a count of each type from
>Details against each Length in SchdLine.
>
>Hope that explains it.
>
>ThanksDifference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)