I am using MySQL. I want to retrieve the next value that the AUTO_INCREMENT column will take without entering a new record.
create table ABC(id int(10) NOT NULL AUTO_INCREMENT,name char(10));
In oracle I would have used sequencename.nextval();
But what to I use in MySQL?
Here is why I did not use
select max(id) from ABC;
Suppose I have an entry with id=2. Now column id will take the next value as 3. Before I create a record with id=3, If I delete the record with id=2. The answer for query I mentioned will be 2. But I want the actual value 3, which the auto_increment column will anyway take.