I wasn't too sure if this was the right place to post but I'm sure there are some SQL gurus here too. Kindly help.
We have a table that looks something like
Code: Select all
LN_NBR RPT_DATE SN_AMT
I am trying to implement this using a windowing function that looks like
Code: Select all
SELECT MIN(SN_AMT) OVER (PARTITION BY LN_NBR ORDER BY RPT_DATE RANGE BETWEEN (StartDate) AND (EndDate)