Reputation: 43
I got MySQL syntax Error 1064 while I am add new column.
ALTER TABLE `customerdetails` ADD `mobile` DOUBLE(12) NOT NULL ;
where customerdetails
is the name of the table.
The Error message is " #1064 - 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 ') NOT NULL' at line 1
Can somebody help me to solve this problem?
Upvotes: 1
Views: 1145
Reputation: 989
When you are defining column type as DOUBLE
you have to define how many decimal places it will use
ALTER TABLE customerdetails ADD mobile DOUBLE(12,2) NOT NULL ;
Also first number (Characteristic) needs to be bigger than second number (Mantissa)
Upvotes: 3