我有一张这样的数据表:|:---------:|:----:|:---------我试过: Order, (MAX(StepEnd) OVER PARTITION BY (Order, Step) - LAG(MIN(StepStart) OVER PARTITION BY (Order, Step), 1, null)
DATE_DATE, CASE WHEN LAG ( DATE_FLAG) OVER( ORDER BY DATE_DATE ) = '1' THEN DATE_STEP = ( LAG ( DATE_FLAG) OVER ( ORDER BY DATE_DATE ) ) + '1'
WHEN LAG ( DATE_FLAG) OVER ( ORDER BY DATE_DATE ) =