-
Notifications
You must be signed in to change notification settings - Fork 688
Order By
Andrey Gershun edited this page Apr 16, 2015
·
4 revisions
Ascending:
alasql('SELECT * FROM City ORDER BY Population');
alasql('SELECT * FROM City ORDER BY Population ASC');Descending:
alasql('SELECT * FROM City ORDER BY Name DESC');AlaSQL supports number notation for ORDER BY arguments:
var data = [{a:2,b:20},{a:2,b:30},{a:3,b:10}];
var res1 = alasql('SELECT a,b FROM ? ORDER BY 2,1',[data]);
var res2 = alasql('SELECT a,b FROM ? ORDER BY 1 DESC,2 DESC',[data]);© 2014-2026, Andrey Gershun & Mathias Rangel Wulff
Please help improve the documentation by opening a PR on the wiki repo