Re: Select max within max
Date: 11 Jul 2008 17:07:15 GMT
On Fri, 11 Jul 2008 04:42:20 -0700, Charles Hooper wrote:
> SELECT DISTINCT
> COLY OLD_COLY,
> MAX(COLY) OVER (PARTITION BY COLX) COLY, MAX(COLZ) OVER (PARTITION
> BY COLX, COLY) COLZ
And, if T1 has few thousand rows, it's going to be full table scan, window sort and sort distinct, in that order. In other words, the resource consumption will just explode. As this is obviously a report, materialized view looks like the only reasonable solution. This is a sort of "mad max" query.