Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

phpMyAdmin showing negative total records for a database table

When I check my database, it's showing negative records for a table (e.g. -200,000), other tables' records are static.

When I view the table and go back to the summary, it changes randomly to -198,000, or -220,000... It's just not static.

What could be happening?

like image 554
Victor Avatar asked Nov 17 '10 13:11

Victor


People also ask

How do I stop negative values in MySQL?

MySQL ABS() function overviewIf n is a negative number, the ABS() function changes the negative value to positive value. In case n is zero or positive, ABS() function has no effect. The data type of the return value is the same as the data type of the input argument.

How do I count rows in MySQL workbench?

To counts all of the rows in a table, whether they contain NULL values or not, use COUNT(*). That form of the COUNT() function basically returns the number of rows in a result set returned by a SELECT statement.


2 Answers

This is an old question but one that I ran into and this post was the first thing to show up on google so I thought I would put the right answer up.

You'll notice that all of the "negative mysql records" questions are with large tables or databases. This isn't a negative sign its ~, which means approximately. It's basically saying that there's around that many records. As far as I can tell, it shows up once any table gets more than 20,000 records in it in phpMyAdmin. This is also why the askers numbers keep fluctuating, it's not exact.

like image 175
Eric Strom Avatar answered Nov 18 '22 06:11

Eric Strom


as Eric Strom already mention that, it is correct which is that sign mean estimated total row by phpMyAdmin. you can always get a rid of that ~ sign or get exact value of its total row by clicking this number. here it is on my own table example :

enter image description here

and after click that number that started with ~ sign, you will get total row exactly after being re-calculated.

![enter image description here

like image 45
Yuda Prawira Avatar answered Nov 18 '22 07:11

Yuda Prawira