Fake auto-increment key in MySQL

Jan 23, 2007 21:58

Sometimes, you want an auto_increment column on a table, but you really don't need an index starting with the column. MySQL doesn't swing that way, so we're left to improvise. Say this is our table:

CREATE TABLE user_things (
    user_id INT NOT NULL,
    thing_index INT NOT NULL,
    PRIMARY KEY(user_id, thing_index)
) ENGINE=InnoDBWhat we'd ( Read more... )

imvu, code

Leave a comment

Comments 1

aegisknight January 24 2007, 18:03:54 UTC
You should add yourself to the technology page! http://www.imvu.com/technology

Reply


Leave a comment

Up