Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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?

Answers were Sorted based on User's Feedback



In table three columns with 1 milion records(here there is no sequence values) i want add one more..

Answer / 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

In table three columns with 1 milion records(here there is no sequence values) i want add one more..

Answer / 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

In table three columns with 1 milion records(here there is no sequence values) i want add one more..

Answer / mohamed shahid

CREATE TABLE T AS SELECT ROWNUM AS seq,emp.* FROM emp;

Is This Answer Correct ?    0 Yes 2 No

In table three columns with 1 milion records(here there is no sequence values) i want add one more..

Answer / kondeti srinivas

select rownum,tablename.* frome tablename;

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More SQL PLSQL Interview Questions

What is normalization in sql?

0 Answers  


How do I truncate a word?

0 Answers  


What is consistency?

0 Answers  


What is information schema in sql?

0 Answers  


create a store procedure and created synonms for that store procedure after modify that store procedure will effect on synonms? If we delete the store procedure what happened to that synonms?

2 Answers   Polaris,


Can we commit in trigger?

0 Answers  


How do I remove sql plus from windows 10?

0 Answers  


What is identity column in sql server?

0 Answers  


Can we join more than 2 tables in sql?

0 Answers  


What is a constraint. Types of constraints ?

5 Answers   Accenture, BirlaSoft,


what are the types of subquery? : Sql dba

0 Answers  


how to install mysql? : Sql dba

0 Answers  


Categories