decimal datatype in MYSQL
by Nirmala[ Edit ] 2009-02-02 09:54:30
Hi...
Decimal Datatype
Syntax:
decimal(M,D).
-> M denots the maximum number of degits.
-> D denotes number of digits to the right of decimal point.
-> M is larger than the D.
If you use decimal datatype,should specify NOT NULL in creating the table.
Create the table:
create table test(id decimal(3,2) NOT NULL,cost decimal(5,2) NOT NULL);
Insert values into the table:
insert into test values(1.10,500.00);