- Notifications
You must be signed in to change notification settings - Fork689
Identity
Mathias Rangel Wulff edited this pageJun 12, 2015 ·4 revisions
Syntax:
CREATETABLEtableid ( columnid typeid IDENTITY [(start [, step])] );
AlaSQL supports autoincrement feature:
alasql('CREATE TABLE one (a INT AUTO_INCREMENT, b STRING)');alasql('INSERT INTO one (b) VALUES ("one"), ("two")');varres=alasql('SELECT * FROM one');// returns [{"a":1,"b":"one"},{"a":2,"b":"two"}]
Try this examplein jsFiddle
By default AlaSQL the initial value is 1 and th step is 1, but you can change it:
alasql('CREATE TABLE one (a INT IDENTITY(10,5), b STRING)');
See also:DEFAULT
© 2014-2026,Andrey Gershun &Mathias Rangel Wulff
Please help improve the documentation by opening a PR on thewiki repo