RESET WHEN in Oracle

Database
sjm
Enthusiast

RESET WHEN in Oracle

Please help me how to write code below one in Oracle DB or Snowflake DB

 

SELECT
               ORIGNM,
               NM,
               MIN(PX_ID) OVER(ORDER BY NM, TBKY DESC RESET WHEN TBKY = 'B') 
FROM tableA
QUALIFY TBKY = 'A'

 

 

 

 

4 REPLIES
Junior Contributor

Re: RESET WHEN in Oracle

You need to apply nested OLAP functions to create a dynamic partition first, see this thread.

 

Btw, it might be possible to implement this logic using a single LAST_VALUE...

sjm
Enthusiast

Re: RESET WHEN in Oracle

 
sjm
Enthusiast

Re: RESET WHEN in Oracle

Finally figured out thanks a lot 

sjm
Enthusiast

Re: RESET WHEN in Oracle

Could you pls share the code how is it implemented in snowflake or oracle