Skip to content
Andrey Gershun edited this page May 27, 2015 · 6 revisions

VALUE

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

See also: MATRIX, COLUMN, ROW, RECORDSET

Clone this wiki locally