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 are the two different parts of the pl/sql packages?

789


what is a constraint? : Sql dba

882


Write a sql query to get the third highest salary of an employee from employee_table?

830


What is a constraint? Tell me about its various levels.

839


explain about mysql and its features. : Sql dba

740






How many primary keys can a table have?

720


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

743


What is cold data?

678


What are the dml statements?

852


what is the difference between blob and text? : Sql dba

724


How many sql databases can you have on one server?

756


What is case function?

778


What is the difference between between and in condition operators?

724


What is the difference between sql, mysql and sql server?

694


Can procedure in package be overloaded?

837