I'm a little fuzzy on the workings of auto-increment. It is not clear to me, what the difference is between auto-increment as a table option and auto-increment as a field option. I can't seem to get either to work (syntax errors).
Does a field have to be an index to get auto-imcremented (as opposed to a primary key)? What field gets incremented if the table option is set? What is the correct syntax for turning it on? I am trying to set it for an existing table:
alter table mytable add primary key (mykeyfield) auto_imcrement;
Could someone explain this to me and tell me what the correct syntax is for alter and create? TIA.
Does a field have to be an index to get auto-imcremented (as opposed to a primary key)? What field gets incremented if the table option is set? What is the correct syntax for turning it on? I am trying to set it for an existing table:
alter table mytable add primary key (mykeyfield) auto_imcrement;
Could someone explain this to me and tell me what the correct syntax is for alter and create? TIA.