Skip to content

Remove Columns

Mathias Rangel Wulff edited this page Jun 12, 2015 · 3 revisions

Keyword REMOVE COLUMNS

Sometimes you may want to select all fields but without some of them.

For example:

    var data = [{a:1,b:10},{a:2,b:20}];
    var res = alasql('SELECT * REMOVE COLUMN b FROM ?',[data]);
    // returns [{a:!},{a:2}]

You can also remove group of columns with LIKE clause:

    SELECT * REMOVE COLUMNS LIKE '%a%',b,c FROM one

With Angular.js AlaSQL automatically remove $$hashKey (see this example)

Clone this wiki locally