Created
November 30, 2016 09:04
-
-
Save antyblin/c79e374a1ee4678a2024e00dac65eb67 to your computer and use it in GitHub Desktop.
Compare current autoincrement value with current field value.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT AUTO_INCREMENT | |
FROM information_schema.tables | |
WHERE table_name = 'tablename' | |
AND table_schema = DATABASE( ) | |
UNION | |
SELECT max(autoincrementfield) from `tablename` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment