

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
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 Questions & Answers
- What are the trees used for furniture and which type of wood last long?
- Which MySQL Data Type can be used to store Negative Number?
- MySQL BIT_LENGTH() function is used for which purpose?
- For timestamp, which datatype is used in MySQL?
- What is the data type for unix_timestamp in MySQL?
- Which MySQL type is most suitable for “price” column?
- Need of long data type in C
- What is the MySQL error: “Data too long for column”?
- Which MySQL Datatype should be used for storing BloodType?
- Which PHP function is used to insert data into an existing MySQL table?
- What is BLOB data type in MySQL?
- What is TEXT data type in MySQL?
- What is MySQL TRUNCATE command used for?
- What is MySQL DROP command used for?
- What is MySQL DELETE command used for?
Advertisements