All column references are case insensitive. A column can be referred to by its position (starting from zero). All operations are non-destructive. That means that a new table object will be returned after, for example, a sort.
An example is available at the end of this section.
object t = ADT.Table.table( ({ ({ "Blixt", "Gordon" }),
({ "Buck", "Rogers" }) }),
({ "First name", "Last name" }) );
object group(funcion f, array(string|int)|string|int columns, mixed ... arg);
array(string) cols = ({ "Fruit", "Provider", "Quantity" });
array(mapping) types = ({ 0, 0, ([ "type":"num" ]) });
array(array) table = ({ ({ "Avocado", "Frukt AB", 314 }),
({ "Banana", "Banankompaniet", 4276 }),
({ "Orange", "Frukt AB", 81 }),
({ "Banana", "Frukt AB", 1174 }),
({ "Orange", "General Food", 523 }) });
object t = ADT.Table.table(table, cols, types);
write("FRUITS\n\n");
write(ADT.Table.ASCII.encode(t, ([ "indent":4 ])));
write("\nPROVIDERS\n\n");
write(ADT.Table.ASCII.encode(t->select("provider", "quantity")->
sum("quantity")->rsort("quantity")));
write("\nBIG PROVIDERS\n\n"+
ADT.Table.ASCII.encode(t->select("provider", "quantity")->
sum("quantity")->
where("quantity", `>, 1000)->
rsort("quantity")));
write("\nASSORTMENT\n\n");
write(ADT.Table.ASCII.encode(t->select("fruit")->distinct("fruit")->
sort("fruit"), ([ "indent":4 ])));