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

How many postgresql users are there, worldwide?

779


what is meant by nl2br()? : Sql dba

762


What is an inconsistent dependency?

761


Is primary key an index?

713


How to fetch values from testtable1 that are not in testtable2 without using not keyword?

958






How many row comparison operators are used while working with a subquery?

754


what is single byte over head in oracle..?

2090


how to create a test table in your mysql server? : Sql dba

684


What are actual parameters and formal parameters?

773


What is varchar sql?

812


Table 1: col1 Timestamp ---------------- 01-mar-2012 11:12:46 Table 2: col2 Timestamp -------------------- 01-mar-2012 11:12:10 01-mar-2012 11:11:23 Write a query to display a row with table2 col2 value less than tabl1 col1 value. Maximum timestamp value previous to table1 col1 value. Display a result as: Col1 col2 ----- ----- 01-mar-2012 11:12:46 01-mar-2012 11:12:10

1899


What is compute?

734


what is a primary key? : Sql dba

749


Explain what is a subquery ?

849


How do I enable sql encryption?

715