[thelist] Auto Increment in database - a goofy question I am sure (long)

Anne Thorniley anne at beerintheevening.com
Thu Apr 18 09:49:00 CDT 2002


>    NOTE: There can be only one AUTO_INCREMENT column per table,
>    and it must be indexed.
> ...
>
> i have no idea what they meant by "it must be indexed"

I think they just mean it must be a key. And since mysql doesn't really take
any notice of foreign keys, that probably means it must be the primary key.
So all the examples just show the auto_increment column being created as
the primary key.

As you said, mysql treats the words key and index pretty much the same...

> note that if you declare the auto_increment column as PRIMARY KEY, then it
> *will* have an index (other databases do this too, although they do not
> make the keywords KEY and INDEX synonymous the way mysql does)

Anne

--
But if I find you and I
Really meant that last goodbye,
Then I'm gonna laugh so hard,
I'll cry.



More information about the thelist mailing list