SQL question, getting error and not sure why
| From: | Michael Sweeney | Date: | Thu, 30 May 2002 14:40:15 +0000 |
| Subject: | SQL question, getting error and not sure why | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-99925@lists.php.net to get a copy of this message | ||
My following query :
insert into acteursenc (nuacteur,nomacteur)
(select AA, BB from
(select max(nuacteur)+1 AA from acteursenc),
(select 'Michael Sweeney' BB from acteursenc))"
produces an ORA-00001: unique constraint error.
The primary key is nuacteur, but by setting AA to max(nuacteur)+1 I should
be getting a new key that is unique, however it does not seem that way.
What am I doing wrong here?