cs.groupn(x;F)

Read(146) Label: cursor, group, bin file,

Description:

Group records of a cursor and write the subset groups as a sequence of bin files.

Syntax:

cs.groupn(x;F)

Note:

The function groups records of cursor cs and writes the subset groups as a sequence of bin files.

Parameters:

cs

Cursor records

x

Grouping expression

F

A sequence of bin file objects

Return value:

The original cursor

Example:

 

A

 

1

=demo.cursor("select NAME,GENDER,DEPT,BIRTHDAY from EMPLOYEE")

 

2

=[file("f_dept.btx"),file("m_dept.btx")]

A sequence of bin file objects

3

=A1.groupn(if(GENDER=="F",1,2);A2)

Put records where GENDER is F into the first group and other records into the second group, and then write the subset groups into a sequence of bin files in order

4

=A3.fetch()