title: In sql search nearest parts start and end Id by dividing it to nth parts based on data count
body: <p>In sql search nearest Ids by dividing it to nth parts based on data count
  like my table have 8000 records and I want to fetch table data in way that it give me start and end id of 8 portions of count</p>
  <p>like from 0 to 1000 the id is 1 to 88899 then start id should be 1 and end id should be 88899 and same for next for 1001 to 2000 the start id should be &gt; 88899 and end id nearest to count 2000 record and so on...</p>