I have a table with 12000+ records, many duplicates.
EmpID, Date, Amt...
I need to add a field (record_number) and populate it starting with 1.. to make it a unique row.
I can add a sequence for future additions but can you tell me how to fill it now?
-- Populate the column:
update <table> set record_number=rownum;
-- Create the sequence
select max(record_number) from <table>;
Create sequence <sequence>
start with <max(record_number)+1>;
Or follow Dima's advice.
----------------------------------------------------------------------------
The person who says it can't be done should not interrupt the person doing it. -- Chinese proverb
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.