I have a table called Meeting with ID auto increment
I want select query to get last auto increment id. However, I used MAX(ID) but there is an issue which is if I delete last record will not work.
I have a table called Meeting with ID auto increment
I want select query to get last auto increment id. However, I used MAX(ID) but there is an issue which is if I delete last record will not work.
use this query:
SELECT `AUTO_INCREMENT`
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_SCHEMA = 'your_db_name'
AND TABLE_NAME = 'your_table_name'