I am getting the MySQL error #1048 - Column 'min' cannot be null when I try to run my insert query. This is my query:
INSERT INTO sys_data
SET sys_userid = '1', sys_groupid = '0',
`origin` = 'admin',`serial` = '200804088',
`min = NULL,`max = NULL,`active` = 'Y';
In response the MySQL returns below error:
#1048 - Column 'min' cannot be null
Any guidance please!
The error #1048 mostly occurs when INSERT query makes try to insert NULL values into a NOT NULL field. I assume that 'min' is a NOT NULL field in your table against which you are inserting NULL value. So you may replace NULL and instead give 0 (if the field is numeric type) to get rid of this error like below:
INSERT INTO sys_data
SET sys_userid = '1', sys_groupid = '0',
`origin` = 'admin',`serial` = '200804088',
`min = 0,`max = NULL,`active` = 'Y';