-
Notifications
You must be signed in to change notification settings - Fork 664
Value
Andrey Gershun edited this page May 27, 2015
·
6 revisions
Usually AlaSQL returns array of records (JavaScript objects), but you can modify SELECT statement to return single value from the first line and first column of result recordset:
var data = [{a:1},{a:2}];
var res = alasql('SELECT COUNT(*) FROM ?',[data]);
// returns [{'COUNT(*)':2}]
var res = alasql('SELECT VALUE COUNT(*) FROM ?',[data]);
// returns 2
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo