Hi...
Found at lot of post discussing LAST_INSERT_ID, but none of the seems to be able to help me.
I would like make query looking like this:
"INSERT INTO node (thread) VALUES (id)".
"id" is an auto_increment column, and I would like to automatically set the value of "thread" to same value as the "id" column, during an insert statement.
LAST_INSERTED_ID() won't work (I should should return a value seen from a global perspective, per connection). And you cannot fo something like
"INSERT INTO node (thread) SELECT MAX(LAST_INSERT_ID(id+1)) from node" as it is an illegal statement (as you cannot have the same table as the target table and in the FROM clause, due to some ANSI SQL restictions.) :-(
Any good suggestion?????????