Search code examples
sqlmysql

Insert NULL value into INT column


How can I insert NULL value into INT column with MySQL? Is it possible?


Solution

  • If the column has the NOT NULL constraint then it won't be possible; but otherwise this is fine:

    INSERT INTO MyTable(MyIntColumn) VALUES(NULL);