- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to make numbers 'human readable' in MySQL?
To make numbers ‘human readable’ i.e. including separators, you need to use format(). Let us first create a table −
mysql> create table DemoTable859(Number bigint); Query OK, 0 rows affected (1.54 sec)
Insert some records in the table using insert command −
mysql> insert into DemoTable859 values(747464646473737); Query OK, 1 row affected (0.45 sec) mysql> insert into DemoTable859 values(3836365366464); Query OK, 1 row affected (0.71 sec) mysql> insert into DemoTable859 values(8376437647433); Query OK, 1 row affected (0.46 sec)
Display all records from the table using select statement −
mysql> select *from DemoTable859;
This will produce the following output −
+-----------------+ | Number | +-----------------+ | 747464646473737 | | 3836365366464 | | 8376437647433 | +-----------------+ 3 rows in set (0.00 sec)
Following is the query to make numbers 'human readable' in MySQL −
mysql> select format(Number, 0) AS HumanReadableFormat from DemoTable859;
This will produce the following output −
+---------------------+ | HumanReadableFormat | +---------------------+ | 747,464,646,473,737 | | 3,836,365,366,464 | | 8,376,437,647,433 | +---------------------+ 3 rows in set (0.00 sec)
- Related Articles
- How to make 'from' as column name in MySQL?
- How to make 'Paneer' at home?
- How to display human readable date in HTML?
- How to delete '' entry in MySQL?
- Convert UNIX timestamp into human readable format in MySQL?
- Implement ORDER BY in MySQL to order records in human readable format?
- Finding the sum of two numbers without using '+', '-', '/', '*' in JavaScript
- How to make MySQL's NOW() and CURDATE() functions use UTC?
- MySQL query to select ENUM('M', 'F') as 'Male' or 'Female'?
- How to deal with 'Boolean' values in PHP & MySQL?
- How to replace 'Empty set' in a MySQL query?
- Converting date from 'dd/mm/yyyy' to 'yyyymmdd' in MySQL
- Program to find number of string we can make where 'a' can be 'a' or 'b', and 'b' remains 'b'in Python
- The difference between 'AND' and '&&' in MySQL?
- How to remove a MySQL collection named 'group'?

Advertisements