Compartir a través de


from ("M" Technical Reference)

[This content is no longer valid. For the latest information on "M", "Quadrant", SQL Server Modeling Services, and the Repository, see the Model Citizen blog.]

The from keyword is used to introduce a scope for one or more iteration identifiers that ranges over a sequence or a join of multiple sequences.

Syntax

from Identifier in Expression

Discussion

The from keyword begins all query statements. It specifies the scope over which the query takes place.

Example

The following shows a function that iterates through the Numbers collection and returns a collection that contains all elements of Numbers that are less than 5. from n in Numbers specifies the scope of the query: the Numbers collection.

module Example {
   
    Numbers : Integer32* { 5, 4, 1, 3, 9, 8, 6, 7, 2, 0}
    
    LowNumbers() { 
        from n in Numbers
        where n < 5
        select n
    }