My table has only a single column calld id. This column is an autoincrementing key (I am using it for sequencing). I want to do something like: insert into sequencer;
but this gives me SQL errors because I guess I need to have a values
portion. But there are no other columns in the table and I want the id column to be autoincremented. I'd also rather not hack this by just adding another dummy column. Thanks.
views:
74answers:
1
+6
A:
INSERT INTO table SET id = NULL;
or
INSERT INTO table VALUES (NULL);
When inserting NULL
into an auto-increment column, mysql will generate a new number instead.
too much php
2009-08-07 02:41:00
Yep, and MySQL's auto-increment also generates a new number when you try to insert zero.
Bill Karwin
2009-08-07 03:11:33