'Theoretically speaking, what prevents T-SQL from supporting COUNT(DISTINCT [...]) in a pivot?
There's no nice way to use COUNT(DISTINCT [...]) as your aggregation function for a T-SQL pivot. Is there any theoretical explanation for why T-SQL does not or can not provide the COUNT(DISTINCT [...]) option for pivot tables? Intuitively, it should not be any different from any other aggregation function. I've looked for any relevant documentation, but I can't even find where the invalidity of COUNT(DISTINCT [...]) is mentioned.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
