mysql row counter
Posted
by
David19801
on Stack Overflow
See other posts from Stack Overflow
or by David19801
Published on 2011-02-11T14:58:49Z
Indexed on
2011/02/11
15:25 UTC
Read the original article
Hit count: 151
Hello,
I have a mysql table. It has auto increment on the id. but I regularly delete rows so the numbers are all over the place. I need to get the last n rows out, but because of deletions, the common way of using the max of the autoincremented id column doesn't work well...
1 - Is their another way to get the bottom 50?
2 - Is their a way to get rows by actual row number? so if I have 4 rows labelled 1,2,3,4 delete row 2 then it will become 1,2,3 rather than 1,3,4?
© Stack Overflow or respective owner