MySQL Forums
Forum List  »  French

innodb and auto_increment as second column
Posted by: Huu Da Tran
Date: July 25, 2008 04:11PM

OUPSSSS mauvais forum, désolé pour le message en anglais.

Is there a way for me to generate an auto_increment as a second column of the primary key in innodb? In documentation, it says that it only works for MyISAM and BDB. I need to assign a serie of schools to a student in order of preferences.
students: student int | username | lastname | firstname
schools: school int | name
students_schools: student | order int | school
In MyISAM, i would have:
primary key (student, order)
unique key (student, school)

I would prefer not having to generate the "order" myself, and use the auto_inc ability to just insert them in order. Am I out of luck?

Thanks for any tips,

Huu Da
MySQL flirter

Edited 1 time(s). Last edit at 07/25/2008 04:12PM by Huu Da Tran.

Options: ReplyQuote

Written By
innodb and auto_increment as second column
July 25, 2008 04:11PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.