How to make data unique?
I want to creat a primary for a table,for example,there is a table named "test" which include field a1,a2,a3,...,I want to make field a1 and a2 to become a primary key,but there is a question,I make primary key failed,because combination of field a1 and a2 raise some same records.I want to know how to erase these same records? The same records are about 5000 records,I can't delete them manually,I want to delete them automatically,for example,if there is five same records,I delete four,and reserve one. How to realize this function? I am a newbie for Oracle,please give detail steps.
Thanks!
|