Hi madhu, i feel you need another index on 'key-value', then assign it the new sequnc= e value, and then again check with previous index.. this is what you require > KEY_VALUE KEY_NEW_VALUE > 10 1 > 30 3 > 20 2 > 50 5 > 40 4 if i write in this way then it look like 10 1 20 2 30 3 40 4 50 5 take care..subodh ----- Original Message ----- From: "Mudhalvan, Moovarkku" <mmudhalvan@xxxxxxxxxxxxxxx> To: <askdba@xxxxxxxxxxxxx> Subject: [askdba] Update using sequences Date: Tue, 26 Oct 2004 11:04:16 +0900 >=20 > Dear Friends, > I have to update the values of one table using Sequence. I know > we can update using sequence and it is working fine using the following > Query.=20 >=20=20 > UPDATE TBL_SEQ_TRANS SET KEY_NEW_VALUE=3D > SEQ_TRANSACTION_ID.NEXTVAL <mailto:SEQ_TRANSACTION_ID.NEXTVAL@CAPITAL>=20 >=20=20=20=20=20 > But i have to update in the ascending order for example my table > TBL_SEQ_TRANS have two fields KEY_VALUE and KEY_NEW_VALUE >=20=20=20=20=20 > KEY_VALUE have the values 10,30,20,50,40 . If i use the above > query it is updating like >=20=20=20=20=20=20=20=20=20 > KEY_VALUE KEY_NEW_VALUE > 10 1 > 30 2 > 20 3 > 50 4 > 40 5 >=20=20 > But i need something like this query UPDATE TBL_SEQ_TRANS SET > KEY_NEW_VALUE=3D SEQ_TRANSACTION_ID.NEXTVAL > <mailto:SEQ_TRANSACTION_ID.NEXTVAL@CAPITAL> ORDER BY KEY_VALUE; > so that i will get the output like=20 >=20=20 > KEY_VALUE KEY_NEW_VALUE > 10 1 > 30 3 > 20 2 > 50 5 > 40 4 > Please let me know if you have any idea. >=20=20 > Thank You > Mudhalvan M.M > ------------------------------------------------------------------------ > ------------ > Global Commercial Real Estate (Japan) Inc. > Moovarkku Mudhalvan, OCP 8i,9i=20 > Database Administator,=20 > E-mail: mmudhalvan@xxxxxxxxxxxxxxx <mailto:mmudhalvan@xxxxxxxxxxxxxxx>=20 >=20=20 >=20 >=20 Good Luck..Subodh Deshpande =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Experience Is Knowledge Wisdom Is Philosophy =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 _______________________________________________ Find what you are looking for with the Lycos Yellow Pages http://r.lycos.com/r/yp_emailfooter/http://yellowpages.lycos.com/default.as= p?SRC=3Dlycos10