0

I have this table:

CREATE TABLE `VormerkListe` (
  `vormerkListeID` int NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`vormerkListeID`)
)

And I try to add a new column with this, found here:

INSERT INTO VormerkListe DEFAULT VALUES;

But I get this error:

INSERT INTO VormerkListe DEFAULT VALUES Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'DEFAULT VALUES' at line 1  0.031 sec
Pixelherz
  • 21
  • 3

2 Answers2

1

You can insert a null value in the auto column. Something like this:

INSERT INTO VormerkListe (vormerkListeID) VALUES(null);

asd-tm
  • 3,381
  • 2
  • 24
  • 41
0

You can also do this:

INSERT INTO VormerkListe () VALUES();

This looks funny, but I use it regularly. It means to use the default for every column in the table.

Bill Karwin
  • 538,548
  • 86
  • 673
  • 828