I have added a new column to my table quote_entry (which already has several columns) with this statement:
ALTER TABLE quote_entry
ADD overtime_id INTEGER;
Now, I'm trying to insert data into the column like this:
INSERT INTO quote_entry (overtime_id)
select 1
FROM quote_entry
WHERE overtime=0;
But this is giving me an error message:
Error: Field 'quote_id' doesn't have a default value
SQLState: HY000
ErrorCode: 1364
I don't understand, why am I getting this error when I'm just trying to modify data in the overtime_id column?
quote_idfield in yourquote_entrytable which DOESN'T have a default value, and since you're not providing a value for that field in yourinsert...selectquery, mysql is properly rejecting your query.on duplicate key update ...structure, or use anupdatequery, not a plain insert.insert= create new record.