Description:
Attach the record filtering action to a cursor and return the original cursor.
Syntax:
cs.select(x)
Note:
The function attaches a computation to cursor cs, which will calculate expression x against each of the records in cursor cs and get records that make value of x true, and return the original cursor cs.
When parameter x is omitted, get all records of cursor cs. The function supports multicursors.
This is a delayed function.
Option:
@v |
Use column-wise computation when parameter cs is a column-wise cursor and also return a column-wise cursor. |
Parameter:
cs |
A cursor. |
x |
A Boolean value. |
Return value:
Cursor
Example:
|
A |
|
1 |
=demo.cursor("select * from SCORES") |
Return a cursor: |
2 |
=A1.select(STUDENTID>10) |
Attach a computation to cursor A1, which will select records where STUDENTID is greater than 10 from the cursor, and return cursor A1: |
3 |
=A1.fetch() |
Fetch data from cursor A1 where A2’s computation is executed (it would be better that data is fetched in batches when a large amount of data is involved): |
When using @v option:
|
A |
|
1 |
=connect("demo").cursor@v("select * from employee") |
Return a column-wise cursor. |
2 |
=A1.select@v(DEPT=="HR") |
Perform column-wise computation. |