sql - How to use in db MySQL decimal? -
i need insert in table tbl_range
of mysql database decimal value:
1866752.0
and set field 'range' in table tbl_range
:
create table `tbl_range` ( `range` decimal(10,5) default null, `id` int(11) not null auto_increment, primary key (`id`) ) engine=myisam default charset=latin1;
but in query insert i've error:
[err] 1264 - out of range value column 'range' @ row 1
you have change:
range
decimal(10,5) default null,
to
range
decimal(15,5) default null,
because 1st parameter indicates total number of digits including decimal values. if putting (10,5) can insert upto 99999.99999. required value greater that.
Comments
Post a Comment