2007/7/11, Olav Mørkrid <[EMAIL PROTECTED]>:

thanks olexandr

my posting had a misprint. the select should be on "mytable" not
"user", so when i use your suggestion, i get an error:

mysql> update test set id = (select max(id) + 1 from test) where id =
'$myid';
ERROR 1093 (HY000): You can't specify target table 'test' for update
in FROM clause

so how does one make a row id to appear as a newly inserted row,
without doing multiple queries?


why do you need this?

you can do insert and use last_ionsert_id() within a transaction (in case
storage engine you're using supports it)

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]




--
Sincerely yours,
Olexandr Melnyk
http://omelnyk.net/

Reply via email to