Changes

Jump to: navigation, search

Creating Databases and Tables Using SQL Commands

218 bytes added, 18:42, 28 September 2007
AUTO_INCREMENT
It is possible to override the AUTO_INCREMENT value of a column simply by specifying a value when executing an INSERT statement. As long as the specified value to unique the value provided will be used in the new row and subsequent increments will start at the newly inserted value.
 
MySQL may be interrogated to retrieve the most recent increment value using the ''last_insert_id()'' function as follows:
 
<pre>
SELECT last_insert_value();
</pre>
 
== Defining Default Values During Table Creation ==

Navigation menu