-
Notifications
You must be signed in to change notification settings - Fork 664
Into
Andrey Gershun edited this page Apr 17, 2015
·
8 revisions
Into table
alasql('SELECT * INTO City FROM Capital');
alasql('SELECT * INTO AfrikanCountries FROM Countries WHERE Country = "Afrika"');
Into external file (into-functions)
alaslq('SELECT * INTO CSV(‘city.csv’) FROM City');
Into stdout (for Node.js):
alasql('SELECT * INTO TXT() FROM City');
You can save data into parametes array. In this case AlaSQL append records to existing array:
var data = [{a:1},{a:2}]; // Source array
var resdata = [{a:0}]; // Destination array
var res = alasql('SELECT * INTO ? FROM ?',[resdata,data]);
AlaSQL returns in res
== 2 - number or records and resdata
equals to [ { a: 0 }, { a: 1 }, { a: 2 } ]
- TXT()
- JSON()
- CSV()
- TSV() / TAB()
- XLSX()
- HTML()
Example of data format conversion from XLSX to CSV:
alasql('SELECT * INTO CSV("parts.csv") FROM XLSX("parts.xlsx") WHERE Qty > 10');
alasql('SELECT * INTO TXT("cities.txt") FROM cities');
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo