2 Different aggregations in the rod

I have a vault

PIVOT
    (
        MIN(DateId)
        FOR Stage IN
        (
            [Start], [Alpha], [Beta], [Release]
        )
    ) as p

I only need MIN for the [Start] column and Max for every other column. How can I achieve this?

+3
source share
1 answer

Can you show the whole query? I would suggest dumping this into a temporary table (or whatever you like) and then creating another point using MAX (DateId) and just merging them together. You can also use more columns by simply creating another PIVOT http://mangalpardeshi.blogspot.com/2009/06/pivot-multiple-columns.html

0
source

Source: https://habr.com/ru/post/1758779/


All Articles