PHIL Sawyer
asked on
Retrieve forward values
Hi
I have a set of data as per the attachment (select company, date, amt, ref from mytable)... and want another column added
which is called Ref2 - see attachment for clarification.
NO PLSQL please.
RegardsEXP_EXCH.xlsx
I have a set of data as per the attachment (select company, date, amt, ref from mytable)... and want another column added
which is called Ref2 - see attachment for clarification.
NO PLSQL please.
RegardsEXP_EXCH.xlsx
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Care to show the execution plan? I modified the UNION WITH to use a real table and it accessed it more than once. Maybe your testing showed something different.
first_value ... with a range like 1 following and unbounded following
just my 2 cents
that looks very much like last_value without a range
last_value(amt) over (partition by company order by ref, mydate)
just my 2 cents
that looks very much like last_value without a range
last_value(amt) over (partition by company order by ref, mydate)
>>that looks very much like last_value without a range
I'm not getting the correct values using your LAST_VALUE example.
I'm not getting the correct values using your LAST_VALUE example.
ASKER
Thanks guys - great work