| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.tools -> New to SQL Analytics and need help
I'm fairly new to sql analytics and need help with an relatively simple
problem.
Given table:
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
I'm using:
update tab_name
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?
Thanks,
Scott
Received on Thu Sep 23 2004 - 08:21:51 CDT
![]() |
![]() |