Get Auto Increment value with MySQL query

Posted by James Simpson on Stack Overflow See other posts from Stack Overflow or by James Simpson
Published on 2009-06-01T04:30:23Z Indexed on 2010/04/04 23:43 UTC
Read the original article Hit count: 313

I currently have a database with over 6 million rows and growing. I currently do SELECT COUNT(id) FROM table; in order to display the number to my users, but the database is getting large and I have no need to store all of those rows except to be able to show the number. Is there a way to select the auto_increment value to display so that I can clear out most of the rows in the database? Using LAST_INSERT_ID() doesn't seem to work.

© Stack Overflow or respective owner

Related posts about mysql-query

Related posts about auto-increment