I get that error when I try to update a table in my database
This is my table
+----+------------+---------+-----------+
| ID | CPRNR | NAME | SURNAME |
+----+------------+---------+-----------+
| 1 | 1234567890 | Ole | Hansson |
| 2 | 9876543211 | Ulla | Jensen |
| 3 | 1234321234 | Ole | Olsson |
| 4 | 7654321234 | Petter | ?es |
| 5 | 9876543213 | Ulla | Jensen |
+----+------------+---------+-----------+
5 rows in set (0.00 sec)
And my update lools like this:
update patient set cprnr='9876543211',fornavn='Ulla',efternavn='Jense n'
where id='5';
This is the error then :
ERROR 1062: Duplicate entry '9876543211' for key 2
I don't get it.
Carl