Re: Sorting a column

From: Dan Blum <>
Date: Thu, 7 Aug 2008 15:11:09 +0000 (UTC)
Message-ID: <g7f3ad$nh0$>

digory <> wrote:
> I just tried the following

> SET pos = DENSE_RANK () OVER (ORDER BY name)

> Unfortunately, this does not work because Oracle does not allow
> analytic functions in the SET clause.

update t

   set pos =

       (select new_id
          from (select rowid, dense_rank() over (order by name) new_id
                  from t) t2
         where t2.rowid = t.rowid); 

Dan Blum					
"I wouldn't have believed it myself if I hadn't just made it up."
Received on Thu Aug 07 2008 - 10:11:09 CDT

Original text of this message