There is nothing to do with "single quotes", columns type int
do not need "quotation marks" in past values
This error:
1264 - Out of range value for column
Indicates that the value you entered exceeded the defined limit, you are probably not entering 2012
, but rather a totally different value (that is, the problem is in the data input) or maybe you have used something like DECIMAL(1,1)
.
You can change the size with ALTER TABLE
(if the type is not int
):
ALTER TABLE veiculos MODIFY COLUMN ano INT(4);
You can also choose the type DATE
or YEAR(4)
, I do not know what the advantages will be with the type of date columns, but maybe it is the use of functions for calculations.
Now if the problem really is in the year, the problem is in the data source.