I am busy with a school project where I query a database based on a server from a client. One of the requirements is to retrieve the next available AutoNumber from the database.
What would the SQL query be to retrieve the next available Autonumber? Is it possible to do this?
It depends on the flavor of the RDBMS. MariaDB (MySQL) have LAST_INSERT_ID() function which gives you the last value of an AUTO_INCREMENT field.
Databases that support sequences (say Ingres) allow you to get next value with something like:
or