[thelist] SQL basic questions

Athena Janiszewski athenaj at rogers.com
Mon Jan 21 22:18:15 CST 2002


> >> another difference is that you have to insert NULLs into them
> >
> >Sorry I think you mean you _can't_ insert nulls into them.
>
> nope, according to the mysql doc,
>
>    "An integer column may have the additional attribute
>     AUTO_INCREMENT. When you insert a value of NULL
>     (recommended) or 0 into an AUTO_INCREMENT column,
>     the column is set to value+1, where value is the largest value
>     for the column currently in the table. AUTO_INCREMENT
>     sequences begin with 1."

I guess I'm just so used to m$ products, where you specifically have to not
allow nulls in an auto-incrementing column, like in MS SQL or Access. And
they won't let you insert null, of course. There is a place I know in
enterprise mgr (for MS SQL) to say what you would like the auto-incrementing
to start at (which is why I guess they want you to insert null or 0 in
mysql) but otherwise it just always starts at 1 by default. Sorry, I've been
spoiled by using enterprise mgr since MS SQL 7 came out, and before that, MS
SQL didnt have auto incrementing columns so I never had to learn how to code
the seed. . plus I can be pretty lazy if I dont need know how to do
something. ..

btw, I just have to say that this list is so educational. I love it! never
go away :)

Athena






More information about the thelist mailing list