Is there an automatic increase across the entire database (not every table!) In mySQL?

Is there a self-contained autonomous ability to automatically increment for ALL tables together in mySQL? I mean not only auto inc for the table, I mean ONE number counting for every new row in the database?

I saw this on a professional oracle (?). The main advantage is that you have a unique identifier for ALL rows / elements in all tables, and not just for PER TABLE.

+5
source share
1 answer

PostgreSQL can be configured this way with CREATE SEQUENCE seq_nameand use nextval(seq_name)for every insert.

MySQL , PostgreSQL SEQUENCE, AUTO_INCREMENT .

, LAST_INSERT_ID , , . , .

- no AUTO_INCREMENT , .

, , UPDATE seq_table SET seq_column = seq_colum+1;, , , , , . , .

, INSERT, , seq_table, .

UPDATE SELECT seq_table ISOLATION LEVEL, , - .

, INSERTS , , .

+6

All Articles