Description:
Generate a multicursor segmented synchronously as an existing multicursor using a specified sequence.
Syntax:
A.cursor@m(mcs,K:K‘,...)
Note:
The function divides ordered sequence A into multiple segments according to multicursor mcs and returns a multicursor. Parameters K and K’ are segmentation keys of A and mcs respectively.
Parameter:
A |
An ordered sequence |
mcs |
A multicursor |
K |
A’s segmentation key |
K’ |
mcs’s segmentation key |
Option:
@p |
Ignore parameters K and K’ and divide ordered sequence A by comparing and matching the first fields of mcs and A |
Return value:
Multicursor
Example:
|
A |
|
1 |
=to(10000).new(#:c1,rand():c2).sort(c1) |
Generate a sequence. |
2 |
=A1.cursor@m(3) |
Generate a multicursor having three subcursors from A1’s table sequence. |
3 |
=to(10000).new(#:k1,rand(10000):k2,rand()*1000:k3).sort(k1) |
Generate a table sequence ordered by k1. |
4 |
=A3.cursor@m(A2,k1:c1) |
Generate a multicursor segmented synchronously as A2’s multicursor, whose segmentation key is c1, based on A3’s table sequence, whose segmentation key is k1. |
5 |
=A3.cursor@mp(A2) |
Generate a multicursor segmented synchronously as A2’s multicursorbased on A3’s table sequence; as @p option is present, perform the segmentation by comparing and matching the first fields of A3 and A2, and in this case segmentation key parameters are not needed in the expression. |