it is possible to insert into a table with only one column, and this column is primary and auto_increment. exactly what I want is to increase id by one and write it to the table ... is it possible without specifying the maximum value and increase it by one, not by insertion. I think direct insertion just increases the value
Yes: INSERT INTO foo (id) VALUES ('')
INSERT INTO foo (id) VALUES ('')
This will add a new entry and the identifier will automatically increment from 1 each time.If this is useful, this is another question .. :-)
, MySQL :
INSERT INTO Foo (id) VALUES (0); INSERT INTO Foo (id) VALUES (''); -- because the integer value of '' is zero INSERT INTO Foo (id) VALUES (NULL); INSERT INTO Foo (id) VALUES (DEFAULT); INSERT INTO Foo () VALUES ();
Source: https://habr.com/ru/post/1767922/More articles:Can anyone recommend a diff web browser to view subversion? - svnmerge two trees - algorithmGCov and GCC, * .da No files created - gcovC #: check the current date on the Internet? - c #You need to return the general partial view to contentresult - asp.net-mvc-2Почему код скомпилирован с Expression.Compile() медленнее, чем обычный С#? - performancePHP as an embedded scripting language - c #Как можно программно настроить горизонтальную ориентацию? - javaУдаление лишних "пустых" символов из массива байтов и преобразование в строку - javacausing "insufficient image data" in pdf - pythonAll Articles