MSYQL overflow.

'CREATE TABLE `test`

(


`id` int(11) NOT NULL AUTO_INCREMENT,

`price` float(7,6) DEFAULT NULL,


PRIMARY KEY (`id`)
) ;


insert into test(price) values (535.566);

Out of range !!!

Not to say that the 7 integers, decimal: 6?

You see my what? 535.566!!!! how can not be inserted into the well?

Started by Barret at February 10, 2016 - 10:24 PM

DOUBLE[(M,D)]

M is the total number of digits
D is the number of digits following the decimal point


So the integer part is 7-6=1

Posted by Marsh at November 26, 2016 - 6:16 PM

The data of 7, of which 6 decimal.

Posted by Miya at November 29, 2016 - 6:58 PM

The problems have been solved, but new problems:


'test', 'CREATE TABLE `test` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `price` float(12,4) NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8'


alter table test  alter column price decimal(13,6);  //error , This is a line of code, I performed in the MySQL GUI.


Posted by Barret at December 12, 2016 - 7:50 PM

float(m,n) M represents the total number of bits, including decimal point, ? ? ?

Posted by Matilda at December 13, 2016 - 8:05 PM

What error? Question please to post error and its analysis information to others.


Description of the problem more and more detailed, more accurate answers will be! See how to ask questions. (question the wisdom of)

Posted by Miya at December 23, 2016 - 8:15 PM

error:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'decimal(13,6)' at line 1

Posted by Barret at December 24, 2016 - 8:49 PM

Does not include.?

Posted by Barret at January 08, 2017 - 9:03 PM

Tested, should not include a decimal point. But float (m, n) behind the decimal integer n, not M-N, behind the decimal point defects will be automatically added. . .

Posted by Matilda at January 13, 2017 - 9:51 PM

Are you there?

What is the integer not letter M-N?

Cannot read, seeking to explain

Posted by Philip at January 15, 2017 - 9:17 PM