-
Notifications
You must be signed in to change notification settings - Fork 664
Recordset
Mathias Wulff edited this page Oct 31, 2022
·
5 revisions
Suggested 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}]
RECORDSET OF SELECT 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