INTERSECTION

4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next

version 3


INTERSECTION (set1; set2; resultSet)

ParameterTypeDescription
set1StringFirst set
set2StringSecond set
resultSetStringResulting set

Description

INTERSECTION compares set1 and set2 and selects only the records that are in both. The following table lists all possible results of a set Intersection operation.

Set1 Set2 Result Set
Yes No No
Yes Yes Yes
No Yes No
No No No

The graphical result of an Intersection operation is displayed here. The shaded area is the result set.

The resultSet is created by INTERSECTION. The resultSet replaces any existing set having the same name, including set1 and set2. Both set1 and set2 must be from the same table. The resultSet belongs to the same table as set1 and set2.

4D Server: In Client/Server mode, sets are "visible" depending on their type (interprocess, process and local) and where they were created (server or client). INTERSECTION requires all three sets to be visible on the same machine. See the paragraph 4D Server, sets and named selections in the 4D Server Reference manual for more information.

Example

The following example finds the customers who are served by two sales representatives, Joe and Abby. Each sales representative has a set that represents his or her customers. The customers that are in both sets are represented by both Joe and Abby:

   INTERSECTION ("Joe"; "Abby"; "Both")  ` Put customers in both sets in Both 
   USE SET ("Both")  ` Use the set 
   CLEAR SET ("Both")  ` Clear this set but save the others 
   DISPLAY SELECTION ([Customers])  ` Display customers served by both 

See Also

DIFFERENCE, UNION.


4D - Documentation   Français   English   German   Spanish   4D v11 SQL, Command Theme List   4D v11 SQL, Command Alphabetical List   4D v11 SQL, Constant Theme List   Back   Previous   Next