New answers tagged auto-increment
If your auto-increments do have a meaning outside of an arbitrary indentifier, maybe they shouldn't be auto_increments, but simple int or bigint unsigned. You can drop the auto_increment particle and just insert max(id)+1, but that would create you all sorts of concurrency problems (that the auto_increment solves for you automatically). You could store the ...
You have to use UUID() function that guarantee that returned string is unique not only within your table or database but all over the world. http://dev.mysql.com/doc/refman/5.5/en/miscellaneous-functions.html#function_uuid A UUID is designed as a number that is globally unique in space and time. Two calls to UUID() are expected to generate two ...
You can have almost any field as the primary key and index it as such. However it would be down to the logic further up the stack (your scripting language most probably to provide unique IDs. You will almost definitely find yourself making additional queries to find unused IDs as the DB grows. One approach to alpha numeric to numeric conversion would be a ...
Well it does now - Oracle 12c introduced IDENTITY columns, see: Identity Columns in Oracle Database 12c Release 1 (12.1) e.g. CREATE TABLE identity_test_tab ( id NUMBER GENERATED ALWAYS AS IDENTITY, description VARCHAR2(30) );
Top 50 recent answers are included