How to add primary key for table with existing data?
704520Jun 9 2009 — edited Jun 10 2009The table is occupied data already. There was no primary key before, so for every column, there are some duplicate values.
I want to add a new column, which should be of the datatype integer, and can automatically increment, starting from 001. I tried this in Oracle SQL Developer, but it says "ORA-01758: table must be empty to add mandatory (NOT NULL) column". How can I do it? Thanks!