0

I am getting the wrong result from Distinct query.

I have trying to get result from column where distinct values but while I am running query

select distict(column_name) from tbl_name;

Getting output : 241091

While I am running :

select * from tbl_name;

getting output : 240469

the output changed.

If I run

select count(*) from tbl_name;

getting output : 241091

Please do help why output varies.

expected result total no of rows distinct showing more value

Nick
  • 138,499
  • 22
  • 57
  • 95
Nick
  • 1
  • 4
  • Phpmyadmin is showing a number wich can be not exact. The count is the good value. https://stackoverflow.com/questions/11926259/why-is-the-estimated-rows-count-very-different-in-phpmyadmin-results – Daniel E. Dec 27 '18 at 08:24

1 Answers1

0

This query: select count(*) from tbl_name; gives you the exact count of the rows in the table.

The number you're seeing when you run this one: select * from tbl_name; is an approximation.

The accepted answer to this question has more details: Why is the estimated rows count very different in phpmyadmin results?

ack_inc
  • 1,015
  • 7
  • 13