4D v13.4

QUERY SELECTION

Home

 
4D v13.4
QUERY SELECTION

QUERY SELECTION 


 

QUERY SELECTION ( {aTable }{;}{ queryArgument {; *}} ) 
Parameter Type   Description
aTable  Table in Table for which to return a selection of records, or Default table, if omitted
queryArgument  Expression in Query argument
Operator in Continue query flag

QUERY SELECTION looks for records in aTable. QUERY SELECTION command changes the current selection of table for the current process and makes the first record of the new selection the current record.

QUERY SELECTION works and performs the same actions as QUERY. The difference between the two commands is the scope of the query:

  • QUERY looks for records among all the records in the table.
  • QUERY SELECTION looks for records among the records currently selected in the table.

For more information, see the description of the command QUERY.

Example  

This example illustrates the difference between QUERY and QUERY SELECTION. Here are two queries:

  ` Find ALL companies located in New York City
 QUERY([Company];[Company]City="New York City")
  ` Find ALL companies doing Stock Exchange business
  ` no matter where they are located
 QUERY([Company];[Company]Type Business="Stock Exchange")

Note that the second QUERY simply “ignores” the result of the first one. Compare this with:

  ` Find ALL companies located in New York City
 QUERY([Company];[Company]City="New York City")
  ` Find companies doing Stock Exchange business
  ` and that are located in New York City
 QUERY SELECTION([Company];[Company]Type Business="Stock Exchange")

QUERY SELECTION looks only among the selected records, therefore, in this example, among the companies located in New York City.

 
PROPERTIES 

Product: 4D
Theme: Queries
Number: 341

The OK variable is changed by the commandThis command modifies the LockedSet system setThis command changes the currrent recordThe command changes the current selection

 
INDEX

Alphabetical list of commands

 
HISTORY 

Modified: 4D v6.5

 
SEE ALSO 

QUERY