In table three columns with 1 milion records(here there is
no sequence values) i want add one more column with
sequence values from the first how it is posible?

Answer Posted / shekharjchandra

Hi
That's a simple one . (if table is tab1)

1. Add column first
ALTER TABLE tab1 add col1 number ;

2. Update the col1 of tab1
UPDATE tab1 SET col1=ROWNUM.

This will populate all the rows in sequential numbers.

Hope this solves u r problem
regards
JC

Is This Answer Correct ?    16 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

666


What is the difference between the sql*loader and import utilities? : aql loader

600


What is sqlca in db2?

536


What are primary key and foreign key and how they work?

556


What are the advantages of stored procedure?

544






What are the advantages of pl sql?

607


What are string functions in sql?

678


What is the use of desc in sql?

496


What sql does db2 use?

544


Is delete faster than truncate?

550


Why stored procedure is better than query?

511


how would you enter characters as hex numbers? : Sql dba

518


What is schema in sql example?

599


What is an invalid partition table?

566


How to create an array in pl/sql?

584