-
Notifications
You must be signed in to change notification settings - Fork 664
Getting started
agershun edited this page Dec 28, 2014
·
16 revisions
Group JavaScript array by field and count number of records in each group:
var data = [{a:1,b:1,c:1},{a:1,b:2,c:1},{a:1,b:3,c:1}, {a:2,b:1,c:1}];
var res = alasql('SELECT a, COUNT(*) AS b FROM ? GROUP BY a',[data]);
console.log(res);
alasql(’ATTACH INDEXEDDB DATABASE MyBase; \
USE MyBase; \
SELECT City.* \
FROM City \
JOIN Country USING CountryCode \
WHERE Country.Continent = ”Asia”’, [], function (res) {
console.log(res.pop());
});
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo