Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7489423
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T15:14:43+00:00 2026-05-29T15:14:43+00:00

I have a MySQL table with many numeric columns (some INT, some FLOAT). I

  • 0

I have a MySQL table with many numeric columns (some INT, some FLOAT). I would like to query it with the MySQL command-line client (specifically, mysql Ver 14.14 Distrib 5.1.41, for debian-linux-gnu (x86_64) using readline 6.1), like so:

SELECT * FROM table WHERE foo;

Unfortunately, if the value of any numeric field exceeds 10^6, this client displays the result in scientific notation, which makes reading the results difficult.

I could correct the problem by FORMAT-ing each of the fields in my query, but there are many of them and many tables I would like to query. Instead I’m hoping to find a client variable or flag I can set to disable scientific notation for all queries.

I have not been able to find one in the --help or the man page, nor searching Google or this site. Instead all I find are discussions of preserving/removing scientific notation when using <insert-programming-language>‘s MySQL API.

Thank you for any tips.

::edit::

Here’s an example table …

mysql> desc foo;
+--------------+-------------+------+-----+-------------------+
| Field        | Type        | Null | Key | Default           |
+--------------+-------------+------+-----+-------------------+
| date         | date        | NO   | PRI | NULL              |
| name         | varchar(20) | NO   | PRI | NULL              |
| val          | float       | NO   |     | NULL              |
| last_updated | timestamp   | NO   |     | CURRENT_TIMESTAMP |
+--------------+-------------+------+-----+-------------------+

and some example values …

mysql> select * from foo where date='20120207';
+------------+--------+--------------+---------------------+
| date       | name   | val          | last_updated        |
+------------+--------+--------------+---------------------+
| 2012-02-07 | A      |      88779.5 | 2012-02-07 13:38:14 |
| 2012-02-07 | B      |  1.00254e+06 | 2012-02-07 13:38:14 |
| 2012-02-07 | C      |      78706.5 | 2012-02-07 13:38:15 |
+------------+--------+--------------+---------------------+

Now, the actual values I loaded into the third field are:

88779.5, 1002539.25, 78706.5390625

and they can be seen exactly if I manipulate the value:

mysql> select date, name, ROUND(val, 10), last_updated from foo where ...
+------------+---+--------------------+---------------------+
| 2012-02-07 | A |   88779.5000000000 | 2012-02-07 13:38:14 |
| 2012-02-07 | B | 1002539.2500000000 | 2012-02-07 13:38:14 |
| 2012-02-07 | C |   78706.5390625000 | 2012-02-07 13:38:15 |

Something in the client seems to be enforcing that I only be allowed to see six significant figures, even though there are more in the table.

If a query such as

mysql> select ROUND(*, 2) from foo ...

were possible, that would be great! Otherwise I can’t really take the time to individually wrap 100 column names in “ROUND()” whenever I need to inspect some data.

Interestingly, I occasionally use a phpMyAdmin interface to browse the contents of some of these tables, and that interface also has this 6 significant figure limitation. So it’s not limited to just the CLI.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T15:14:44+00:00Added an answer on May 29, 2026 at 3:14 pm

    Well, after reading the documentation more thoroughly, I still can’t see any reason why a client would limit itself to displaying only 6 sig figs from a FLOAT (especially when the table itself is definitely storing more).

    Nonetheless, an acceptable solution (for this weary user) is to change all my tables to use DECIMAL(16,4) instead of FLOAT. Unfortunately, this makes all my numbers show up with 4 decimal places (even if they’re all ‘0’). But at least all numbers have the same width now, and my client never displays them in scientific notation or limits the number of sig figs in its output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a MySQL table that holds many entries with repeated IDs (for various
I have a MySQL table consisting of: CREATE TABLE `url_list` ( `id` int(10) unsigned
I have a MySQL table containing phone numbers that may be formatted in many
So I have a mysql table of many 'article title' and 'article body's My
I have many rows in a mysql table. There is an order_id column. I
I have a MySQL table that contains many rows. The table structure is as
I have a Mysql table where it combines three tables. This table stores some
I have a MySQL table to hold tags (i.e. like those used here on
I have a MySql table, which I want to query for rows in which
I have a MySQL table like this CREATE TABLE IF NOT EXISTS `vals` (

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.