-
Notifications
You must be signed in to change notification settings - Fork 665
Recordset
Mathias Rangel Wulff edited this page Nov 24, 2015
·
5 revisions
Syntax:
RECORDSET OF SELECT ...
Alternative syntax:
SELECT RECORDSET...
Usually AlaSQL returns array of records (JavaScript objects), but you can modify SELECT statement to return an object with both data (as normal select) and data about the order of the rows in the select.
AlaSQL modifier for SELECT queries.
SET @data = @[{a:1,b:10},{a:2,b:20}];
SELECT a, b FROM @data;
-- returns array of objects [{a:1,b:10},{a:2,b:20}]
SELECT RECORDSET a, b FROM @data;
-- returns array of objects
-- {data:[{a:1,b:10},{a:2,b:20}] , columns:[{columnid:'a'},{columnid:'b'}]}
You can change also query modifier with AlaSQL options:
alasql.options.modifier = 'RECORDSET';
By default, all nestes subqueries returns data as Recordset.
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo