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
How many postgresql users are there, worldwide?
what is meant by nl2br()? : Sql dba
What is an inconsistent dependency?
Is primary key an index?
How to fetch values from testtable1 that are not in testtable2 without using not keyword?
How many row comparison operators are used while working with a subquery?
what is single byte over head in oracle..?
how to create a test table in your mysql server? : Sql dba
What are actual parameters and formal parameters?
What is varchar sql?
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
What is compute?
what is a primary key? : Sql dba
Explain what is a subquery ?
How do I enable sql encryption?