-
Notifications
You must be signed in to change notification settings - Fork 664
INSERT
Mathias Rangel Wulff edited this page Feb 20, 2017
·
1 revision
Syntax:
INSERT INTO table [(column1, column2...)] [VALUE[S]] valuePair1, valuePair2, ...;
INSERT INTO table DEFAULT VALUES;
INSERT INTO table SELECT ...;
[INSERT [VALUES]](Insert Values)
alasql('INSERT INTO city (name, population) VALUES ("Moscow",11500000), ("Kyiv",5000000)');
alasql('INSERT INTO city VALUES {population:4000000, name:"Berlin"}');
alasql('INSERT INTO city VALUES ?', [data]);
alasql('INSERT INTO city VALUES ("Copenhagen",1000000)');
alasql('INSERT INTO city VALUE ("Barcelona",1600000)');
alasql('INSERT INTO city ("Paris",3500000)');
[INSERT DEFAULT VALUES](Insert Default Values)
alasql('INSERT INTO city DEFAULT VALUES');
[INSERT SELECT](Insert Select) (equivalent of SELECT INTO)
alasql('INSERT INTO city SELECT capital AS name FROM country GROUP BY capital;');
An INSERT
statement will return the amount of rows inserted by the statment.
See also: INTO, [SELECT INTO](Select Into)
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo