Image

Imagexterminal wrote in Imagesqlserver

Aggregation 101.

I'm overlooking the absurdly obvious, and I realize it...

What, in T-SQL, is a way to do this:

sum(count(distinct claimno)) as claimcount,...

that does not involve getting this:

Cannot perform an aggregate function on an expression containing an aggregate or a subquery.

as a return message?

(I would like to keep this as one statement rather than using temp tables, cursors, or anything like that as an intermediary.)

TIA.