Skip to content

Group By

agershun edited this page Jan 10, 2015 · 7 revisions

SELECT GROUP BY

Grouping by columns:

    var res = alasql('SELECT * FROM City GROUP BY Contient, Country');

Grouping by expressions:

    var res = alasql('SELECT b FROM Nums GROUP BY a%2');

Grouping functions

  • CUBE()
  • ROLLUP()
  • GROUPING SETS()
    alasql('SELECT * FROM City GROUP BY ROLLUP(Continent, Country)');
Clone this wiki locally