Skip to content
Mathias Rangel Wulff edited this page Jun 12, 2015 · 4 revisions

Keyword TOP

Select top 10 records of data table:

    alasql('SELECT TOP 10 * FROM Cities ORDER BY Name');

Select top 10 records of array:

    var data = [];
    for(var i=0;i<100;i++) data.push({num:i});
    var res = alasql('SELECT TOP 10 * FROM ?',[data]);

See also: SELECT

Clone this wiki locally