Well, the other day I was checking a table. There is a primary key on the column PriKey. Here are the rows:
Select PriKey from TableName; PriKey ------ 1 1
I got two rows with the same value. The table does have a primary key on this column and it is enforced. I can test it by inserting another record with the same value - “1”:
SQL> insert into TableName values (1,…)It errors with ORA-00001: unique constraint violated error. The question is: why there are two rows with duplicate values in a column that has an enforced primary key, and it refuses to accept the very value that is already violated the primary key? It could be a great interview question, test your mettle; or just entertaining. Read on for the answer.