title: MySQL auto increment and select count
body: <p>I am having a strange issue with MySQL Query, i am having a table with the fields </p>
  
  <blockquote>
    <p>slno,mobileno , contractor with slno as primary key  and auto
    increment sequence 1</p>
  </blockquote>
  
  <p>, while test say uptil 100 records the count and the autoincrement values are same , </p>
  
  <p>so i truncated the table to reset the autoincrement and inserted a huge excel file with around 40k data via php, then issued select query which yields </p>
  
  <blockquote>
    <p>the max of slno is 40000 as expected but the count shows 39920</p>
  </blockquote>
  
  <p>, I am just amused and tried to find over google , may be my lack of keyword search ability prevented me from finding result, so i am posting in here, for ref added screen shot, Any ideas and clarifications. Thanks</p>
  
  <p><a href="https://i.stack.imgur.com/07tIE.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/07tIE.jpg" alt="enter image description here"></a></p>
  
  <p>EDIT:
  min slno is 1</p>
  
  <p><a href="https://i.stack.imgur.com/6kVvX.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6kVvX.jpg" alt="enter image description here"></a></p>
  
  <p>EDIT :
  A related question with solution to find gap in auto number in mysql has been <a href="https://stackoverflow.com/q/4340793/186244">asked and solved here</a>.</p>