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

What is a subquery in sql?

511


How is pl sql different from sql?

547


Explian rowid, rownum?

564


Can we use update in sql function?

583


How do we use distinct statement? What is its use?

551






What is implicit cursor in pl sql?

541


Why is sharding used?

552


What is difference between pl and sql?

532


What is data types in sql?

535


How do you truncate?

505


what is view? : Sql dba

556


Is it possible to link two groups inside a cross products after the cross products group has been created?

595


Explian rowid, rownum? What are the psoducolumns we have?

574


What is nested table in pl sql?

555


What are the various restrictions imposed on view in terms of dml?

521