Portable SQL/Statements/IDs/Generating IDs

From Linuxnetworks
< Portable SQL‎ | Statements/IDs
Revision as of 00:21, 29 August 2007 by Nose (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

MySQL

CREATE TABLE table (
  id <type> NOT NULL AUTO_INCREMENT
);

The column types can be:

  • TINYINT
  • SMALLINT
  • INTEGER
  • BIGINT

SQLite

CREATE TABLE table (
  id INTEGER NOT NULL AUTOINCREMENT
);

Only INTEGER column types are allowed for generated IDs.