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 / saraswathi muthuraman

SQL> desc ts_200;
Name Null? Type
----------------------------------------- --------
A NUMBER


SQL> alter table ts_200 add b number;

Table altered.

SQL> desc ts_200;
Name Null? Type
----------------------------------------- --------
A NUMBER
B NUMBER

SQL> select * from ts_200;

A B
---------- ----------
1
3
7

3 rows selected.

SQL> update ts_200 set b=rownum;

3 rows updated.

SQL> select * from ts_200;

A B
---------- ----------
1 1
3 2
7 3

3 rows selected.

Is This Answer Correct ?    7 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Compare sql & pl/sql

605


What are commit, rollback, and savepoint?

569


How do you remove duplicates without using distinct in sql?

499


How to display the records between two range in Oracle SQL Plus?

636


How do you update a table in sql?

519






Can you join a table to itself?

540


What sql does db2 use?

540


Differences between Oracle 9i and 10g (Probably in terms of SQL and PL/SQL)?

3105


What is audit logout in sql profiler?

585


What is autocommit sql?

538


What is the need of merge statement?

550


What is procedure function?

537


What is sqlite used for?

528


What does fetching a cursor do?

613


what tools available for managing mysql server? : Sql dba

529