
- Learn MySQL
- MySQL - Home
- MySQL - Introduction
- MySQL - Installation
- MySQL - Administration
- MySQL - PHP Syntax
- MySQL - Connection
- MySQL - Create Database
- MySQL - Drop Database
- MySQL - Select Database
- MySQL - Data Types
- MySQL - Create Tables
- MySQL - Drop Tables
- MySQL - Insert Query
- MySQL - Select Query
- MySQL - Where Clause
- MySQL - Update Query
- MySQL - Delete Query
- MySQL - Like Clause
- MySQL - Sorting Results
- MySQL - Using Join
- MySQL - NULL Values
- MySQL - Regexps
- MySQL - Transactions
- MySQL - Alter Command
- MySQL - Indexes
- MySQL - Temporary Tables
- MySQL - Clone Tables
- MySQL - Database Info
- MySQL - Using Sequences
- MySQL - Handling Duplicates
- MySQL - SQL Injection
- MySQL - Database Export
- MySQL - Database Import
Which MySQL data type is used for long decimal?
For this, use DECIMAL(21,20). Let us first create a table −
mysql> create table DemoTable1493 -> ( -> LongValue DECIMAL(21,20) -> ); Query OK, 0 rows affected (0.48 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable1493 values(1.0047464644664677373); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable1493 values(5.999999484757773); Query OK, 1 row affected (0.10 sec) mysql> insert into DemoTable1493 values(0.009994995885885); Query OK, 1 row affected (0.21 sec)
Display all records from the table using select statement −
mysql> select * from DemoTable1493;
This will produce the following output −
+------------------------+ | LongValue | +------------------------+ | 1.00474646446646773730 | | 5.99999948475777300000 | | 0.00999499588588500000 | +------------------------+ 3 rows in set (0.00 sec)
- Related Articles
- Which MySQL Data Type can be used to store Negative Number?
- What are the trees used for furniture and which type of wood last long?
- What is the MySQL error: “Data too long for column”?
- What is the data type for unix_timestamp in MySQL?
- MySQL BIT_LENGTH() function is used for which purpose?
- For timestamp, which datatype is used in MySQL?
- Which MySQL type is most suitable for “price” column?
- Need of long data type in C
- Best data type for storing large strings in MySQL?
- What is BLOB data type in MySQL?
- What is TEXT data type in MySQL?
- Which PHP function is used to insert data into an existing MySQL table?
- Is there any need of “long” data type in C and C++?
- What is MySQL ENUM data type? What are the advantages to use ENUM data type?
- How Java is Used for Data Science?

Advertisements