New to SQL Analytics and need help
Date: Thu, 23 Sep 2004 09:21:51 -0400
I'm fairly new to sql analytics and need help with an relatively simple problem.
ID Operation Date Old_Loc New_Loc 100 9/1/04 12:34 B1 100 9/1/04 12:45 B2 100 9/1/04 13:30 I want to move the location down by one record so the result will be ID Operation Date Old_Loc New_Loc 100 9/1/04 12:34 B1 100 9/1/04 12:45 B2 B1 100 9/1/04 13:30 B2
set new_loc = (select lead(old_loc) over (partition by id order by operation_dt) from tab_name);
but I'm getting Ora 1427 - Single-row subquery returns more than one row.
Like I said, I'm new to sql analytics so I may be completely off base.
Can anyone offer some insight?
Scott Received on Thu Sep 23 2004 - 15:21:51 CEST