I have a problem and would really appreciate if someone can help me with that. I am trying to create some tables in mysql. I want that all the new rows created for any table should come from single row-id pool. I will be more precise here. What i want is that when i create a new row doesnt matter which table it is, the row Id should be incremental to the previous row id (same or someother table). This way all the rowids of all the tables will be unique. Is there a way in MYSQL to do it.
is there a way? yes, but you don't really want to go there
set up a new table with an auto_increment id
then, any time you want to obtain a new row_id, lock this table, insert a row, grab the generated auto_increment value, use it to insert the new row for your other table, then come back to the auto_increment table and delete the row you just inserted (so that this table doesn't grow in size), then unlock the table
this will give you what you want, but make your application perform quite poorly