# xor()

Read（385） Label: integer, xor operation,

Description:

Perform XOR operation on integers.

Syntax:

xor(xi,…)

xor(A)

Note:

The function performs XOR operation on integers.

Parameters:

 A A sequence xi The numerical expression based on which you perform the XOR operation

Return value:

An integer

Example:

 xor(6,11) 13

xunion()

Here’s how to use xunion() function.

Description:

Generate a new sequence by uniting and rearranging distinct members in each of a sequence’s sub-sequences.

Syntax:

A.xunion()

Note:

The function forms a new sequence by uniting and rearranging distinct members in each of sequence A’s sub-sequences. Same members after the distinct operation won’t be removed.

Parameters:

 A A sequence consisting of sequences

Return value:

A sequence

Example:

 A 1 =[[1,2,3,3,4],[1,1,3]].xunion() [2,3,4,1] 2 =[[1,2,3,3,4],[1,1,3],].xunion() [2,3,1] 3 =[[1,2],[]].xunion() [1,2] 4 =demo.query("select top 2 * from EMPLOYEE") 5 =demo.query("select top 1 * from EMPLOYEE") 6 =[A4,A5].xunion() A4 and A5 come from two table sequences stored in different places, so same records are treated as different members

Related functions:

A.isect()

A.diff()

A.xunion(x)

Description:

Calculate an expression with each member of every sub-sequence of a sequence to generate a new sequence by uniting and rearranging distinct members in each of the resulting sub-sequences.

Syntax:

A.xunion(x)

Note:

Over sequence A whose members are also sequences, the function calculates expression x with each member of every sub-sequence, and forms a new sequence by uniting and rearranging distinct members in each of the resulting sub-sequences. Same members after the distinct operation won’t be removed.

Parameters:

 A A sequence consisting of sequences x An expression whose value is a sequence

Return value:

A sequence

Example:

 A 1 =demo.query("select EID,SURNAME,GENDER from EMPLOYEE where GENDER = 'M' and EID < 20") 2 =demo.query("select EID,SURNAME,GENDER from EMPLOYEE where GENDER = 'F' and EID < 20") 3 =[A1,A2].xunion(~.(SURNAME)) Rearranging distinct members in A1 and A2 to generate a new sequence; Same members after the distinct operation won’t be removed

Related functions: