The number of columns in the table should be equal to the number of values if you decide not to use the column names in the statement. For example, if you have 4 columns in which the first is the identifier, the second and third are NULL, and the fourth is int 0 by default.
You can do
INSERT INTO globalSettings DEFAULT VALUES
OR
You can specify all values:
INSERT INTO globalSettings Values (NULL, NULL, 0)
OR
You can specify columns, and the rest are null or 0 by default.
INSERT INTO globalSettings(secondColumn) VALUES (Default)
OR
INSERT INTO globalSettings(secondColumn) VALUES (null)
This will insert a row with 1, null, null, 0
You cannot insert into a table without specifying what you want to insert.
source
share