How can I insert NULL value into INT column with MySQL? Is it possible?
6 Answers
The optimal solution for this is provide it as '0' and while using string use it as 'null' when using integer.
ex:
INSERT INTO table_name(column_name) VALUES(NULL);
1 Comment
borjab
0 and null has very different meanings. Null could mean we do not have the data. 0 means we know it is zero. Or lets imagine a referecence to user_id. 0 will point to record with id 0 while null means there is no user.