Re: New to SQL Analytics and need help

From: Pratap <>
Date: 24 Sep 2004 02:42:36 -0700
Message-ID: <>

You have to lead LAG instead of LEAD

To update, if you have few rows then this will work fine -

 for rec in
   select lead(old_loc) over (partition by id order by operation_dt) a, rowid rid

   from tab_name

    update tab_name set new_loc = rec.a where rowid = rid  end loop;

But if you have too many rows and performance is an issue then use merge command as given here -


Pratap Received on Fri Sep 24 2004 - 11:42:36 CEST

Original text of this message