-
Notifications
You must be signed in to change notification settings - Fork 681
Having
agershun edited this page Jan 10, 2015
·
6 revisions
Filtering groups by expressions:
For example, select countries with number of cities > 2:
var res = alasql('SELECT *, COUNT(*) AS cnt FROM City \
GROUP BY Country \
HAVING cnt > 2');
Expressions can contain aggregators, like below:
var res = alasql('SELECT * FROM City \
GROUP BY Country \
HAVING COUNT(*) > 2');
© 2014-2024, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo