<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://sqlzoo.net/w/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;feed=atom&amp;action=history</id>
		<title>Autonumber fields - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;feed=atom&amp;action=history"/>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;action=history"/>
		<updated>2013-06-20T05:25:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.20.4</generator>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;diff=1705&amp;oldid=prev</id>
		<title>Marek at 09:38, 18 July 2012</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;diff=1705&amp;oldid=prev"/>
				<updated>2012-07-18T09:38:50Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:38, 18 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 98:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[http://dev.mysql.com/doc/mysql/en/create-table.html CREATE TABLE]&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[http://dev.mysql.com/doc/mysql/en/create-table.html CREATE TABLE]&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;[http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html Examples of auto increment]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Examples of auto increment]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-db2&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;[https://aurora.vcu.edu/db2help/db2s0/frame3.htm#sqls0621 CREATE TABLE]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-db2&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;[https://aurora.vcu.edu/db2help/db2s0/frame3.htm#sqls0621 CREATE TABLE]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-sqlserver&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ia-iz_3iex.asp IDENTITY property]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-sqlserver&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;[http://msdn.microsoft.com/library/en-us/tsqlref/ts_ia-iz_3iex.asp IDENTITY property]&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Marek</name></author>	</entry>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;diff=1703&amp;oldid=prev</id>
		<title>Marek at 09:36, 18 July 2012</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;diff=1703&amp;oldid=prev"/>
				<updated>2012-07-18T09:36:20Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
			&lt;tr style='vertical-align: top;'&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;← Older revision&lt;/td&gt;
			&lt;td colspan='2' style=&quot;background-color: white; color:black;&quot;&gt;Revision as of 09:36, 18 July 2012&lt;/td&gt;
			&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 97:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 97:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;index.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;index.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;a href=&amp;quot;&lt;/del&gt;http://dev.mysql.com/doc/mysql/en/create-table.html&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&amp;gt;&lt;/del&gt;CREATE TABLE&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/a&amp;gt;&amp;lt;a href=&amp;quot; &lt;/del&gt;http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&amp;gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;http://dev.mysql.com/doc/mysql/en/create-table.html CREATE TABLE&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Examples of auto increment&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/a&amp;gt;&lt;/del&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html &amp;#160;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-db2&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;a href=&amp;quot;&lt;/del&gt;https://aurora.vcu.edu/db2help/db2s0/frame3.htm#sqls0621&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&amp;gt;&lt;/del&gt;CREATE TABLE&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/a&amp;gt;&lt;/del&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;Examples of auto increment&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-sqlserver&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;a href=&amp;quot;&lt;/del&gt;http://msdn.microsoft.com/library/en-us/tsqlref/ts_ia-iz_3iex.asp&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&amp;gt;&lt;/del&gt;IDENTITY property&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/a&amp;gt;&lt;/del&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-db2&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;https://aurora.vcu.edu/db2help/db2s0/frame3.htm#sqls0621 CREATE TABLE&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-sqlserver&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;http://msdn.microsoft.com/library/en-us/tsqlref/ts_ia-iz_3iex.asp IDENTITY property&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-mimer&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;We create a &amp;lt;code&amp;gt;SEQUENCE&amp;lt;/code&amp;gt; and ensure that the autonumber field&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-mimer&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;We create a &amp;lt;code&amp;gt;SEQUENCE&amp;lt;/code&amp;gt; and ensure that the autonumber field&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;defaults top the next value.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;defaults top the next value.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;background: #ffa; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-oracle&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;a href=&amp;quot;&lt;/del&gt;http://sqlzoo.napier.ac.uk/big/B/s/a/sql_elements6a.htm&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;quot;&amp;gt;&lt;/del&gt;SEQUENCE nextval&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;/a&amp;gt;&lt;/del&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;background: #cfc; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;div class=&amp;quot;ecomm e-oracle&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;[&lt;/ins&gt;http://sqlzoo.napier.ac.uk/big/B/s/a/sql_elements6a.htm SEQUENCE nextval&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;]&lt;/ins&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;&amp;lt;/div&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{CREATE and DROP ref}}&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background: #eee; color:black; font-size: smaller;&quot;&gt;&lt;div&gt;{{CREATE and DROP ref}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Marek</name></author>	</entry>

	<entry>
		<id>http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;diff=1111&amp;oldid=prev</id>
		<title>Marek: Created page with &quot;CREATE a table with an autonumber / sequence / identity / autoincrement &lt;div class='ht'&gt; &lt;div class=params&gt;schema:scott&lt;/div&gt; &lt;div&gt; An auto number field can provide a unique i...&quot;</title>
		<link rel="alternate" type="text/html" href="http://sqlzoo.net/w/index.php?title=Autonumber_fields&amp;diff=1111&amp;oldid=prev"/>
				<updated>2012-07-12T15:29:39Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;CREATE a table with an autonumber / sequence / identity / autoincrement &amp;lt;div class=&amp;#039;ht&amp;#039;&amp;gt; &amp;lt;div class=params&amp;gt;schema:scott&amp;lt;/div&amp;gt; &amp;lt;div&amp;gt; An auto number field can provide a unique i...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;CREATE a table with an autonumber / sequence / identity / autoincrement&lt;br /&gt;
&amp;lt;div class='ht'&amp;gt;&lt;br /&gt;
&amp;lt;div class=params&amp;gt;schema:scott&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div&amp;gt;&lt;br /&gt;
An auto number field can provide a unique identifier where no other is&lt;br /&gt;
available.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=sql class='tidy'&amp;gt;DROP TABLE t_test;&lt;br /&gt;
DROP sequence sq&amp;lt;/source&amp;gt;&lt;br /&gt;
&amp;lt;source lang=sql class='setup'&amp;gt;&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-access'&amp;gt;CREATE TABLE t_test(&lt;br /&gt;
 id COUNTER PRIMARY KEY,&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Andrew');&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-db2'&amp;gt;CREATE TABLE t_test(&lt;br /&gt;
 id INTEGER&lt;br /&gt;
      GENERATED ALWAYS AS IDENTITY&lt;br /&gt;
      PRIMARY KEY,&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Andrew');&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-mysql'&amp;gt;CREATE TABLE t_test(&lt;br /&gt;
 id INTEGER AUTO_INCREMENT PRIMARY KEY,&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Andrew');&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sqlite'&amp;gt;CREATE TABLE t_test(&lt;br /&gt;
 id INTEGER PRIMARY KEY AUTOINCREMENT,&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Andrew');&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-sqlserver e-sybase'&amp;gt;CREATE TABLE t_test(&lt;br /&gt;
 id INTEGER IDENTITY&lt;br /&gt;
      PRIMARY KEY,&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Andrew');&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-oracle'&amp;gt;CREATE SEQUENCE sq;&lt;br /&gt;
CREATE TABLE t_test(&lt;br /&gt;
 id INTEGER PRIMARY KEY,&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(id,name)&lt;br /&gt;
 VALUES (sq.nextval,'Andrew');&lt;br /&gt;
INSERT INTO t_test(id,name)&lt;br /&gt;
 VALUES (sq.nextval,'Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def e-postgres'&amp;gt;CREATE SEQUENCE sq;&lt;br /&gt;
CREATE TABLE t_test(&lt;br /&gt;
 id INTEGER PRIMARY KEY DEFAULT NEXTVAL('sq'),&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(name)&lt;br /&gt;
 VALUES ('Andrew');&lt;br /&gt;
INSERT INTO t_test(name)&lt;br /&gt;
 VALUES ('Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang='sql' class='def'&amp;gt;CREATE SEQUENCE sq;&lt;br /&gt;
CREATE TABLE t_test(&lt;br /&gt;
 id INTEGER PRIMARY KEY DEFAULT NEXT_VALUE OF sq,&lt;br /&gt;
 name VARCHAR(10)&lt;br /&gt;
 );&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Andrew');&lt;br /&gt;
INSERT INTO t_test(name) VALUES ('Gordon');&lt;br /&gt;
SELECT * FROM t_test;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-access&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;Use &amp;lt;code&amp;gt;COUNTER&amp;lt;/code&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-mysql&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;You may specify AUTO_INCREMENT on a secondary column in a multiple column&lt;br /&gt;
index.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;a href=&amp;quot;http://dev.mysql.com/doc/mysql/en/create-table.html&amp;quot;&amp;gt;CREATE TABLE&amp;lt;/a&amp;gt;&amp;lt;a href=&amp;quot; http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html&amp;quot;&amp;gt;&lt;br /&gt;
Examples of auto increment&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-db2&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;https://aurora.vcu.edu/db2help/db2s0/frame3.htm#sqls0621&amp;quot;&amp;gt;CREATE TABLE&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-sqlserver&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://msdn.microsoft.com/library/en-us/tsqlref/ts_ia-iz_3iex.asp&amp;quot;&amp;gt;IDENTITY property&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-mimer&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;We create a &amp;lt;code&amp;gt;SEQUENCE&amp;lt;/code&amp;gt; and ensure that the autonumber field&lt;br /&gt;
defaults top the next value.&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&amp;lt;div class=&amp;quot;ecomm e-oracle&amp;quot; style=&amp;quot;display: none&amp;quot;&amp;gt;&amp;lt;a href=&amp;quot;http://sqlzoo.napier.ac.uk/big/B/s/a/sql_elements6a.htm&amp;quot;&amp;gt;SEQUENCE nextval&amp;lt;/a&amp;gt;&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
{{CREATE and DROP ref}}&lt;/div&gt;</summary>
		<author><name>Marek</name></author>	</entry>

	</feed>