xjoinx()

Read(2447) Label: multiple, cursor, cross join,

Description:

Perform cross join over table sequences represented by cursors and return a multicursor.

Syntax:

xjoinx(csi:Fi,xi,..;…)

Note:

Perform cross join on cursors/table sequences csi unconditionally to generate a new cursor composed of Fi,… fields. Each Fi references a member of the corresponding original cursor csi. The operation will filter members of csi according to the filtering criterion xi if it is supplied. Parameter csi is retraversable unicursors or table sequences.

This is a delayed function.

Option:

@1

Perform left join (Note: here is the number 1). Use null to participate in the cross join if there are no matching members in cursors csi

Parameter:

Fi

Names of fields of the result table sequence

csi

Unicursors or table sequences to be joined

xi

Filtering expression

Return value:

Multicursor

Example:

 

A

 

1

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

Return a cursor whose data is as follows:

2

=demo.query("select distinct RELATION from FAMILY " )

Return a table sequence:

3

=xjoinx(A1:Emp;A2:Family)

Perform cross join over A1 and A2.

4

=A3.fetch()

Fetch data from cursor A3:

 

When filter condition xi is specified:

 

A

 

1

=demo.cursor("select top 10 EID,NAME,DEPT,GENDER from EMPLOYEE " )

Return a cursor whose data is as follows:

2

=demo.cursor("select  top 10 EID,NAME,RELATION,GENDER,AGE from FAMILY " )

Return a cursor whose data is as follows:

3

=xjoinx(A1:Emp;A2:Family,EID==Emp.EID)

Cross join with a filter condition.

4

=A3.fetch()

Fetch data from cursor A3:

 

Use @1 option to enable left join:

 

A

 

1

=demo.cursor("select top 10 EID,NAME,DEPT,GENDER from EMPLOYEE " )

Return a cursor whose data is as follows:

2

=demo.query("select  top 10 EID,NAME,RELATION,GENDER,AGE from FAMILY " )

Return a table sequence:

3

=xjoinx@1(A1:Emp;A2:Family,EID==Emp.EID)

Left join-style cross join.

4

=A3.fetch()

Fetch data from cursor A3:

Related function:

xjoin()