HOPEX Power Studio (EN) : Customizing the Metamodel : Query Syntax : Query General Syntax: Select : Queries containing several selects
   
Queries containing several selects
You can use several "Select" clauses in the same query. "Select" clauses follow the same rules as queries that have only one clause. The only difference is that the name specified after the "From" operator can match the result ("Into") of a previous "Select" clause.
This allows you to use intermediate results without having to save them.
Note that the intermediate results are not saved; only the last result is displayed on completion of query execution.
*You can put “Select” clauses on different lines. When entering the query, you can insert a line break by pressing the <Ctrl> and <Enter> keys simultaneously.
Examples:
Find the material flows of a project:
Select Message into @MaterialFlow where Flow-Type = “Material Flow”
Select from @MaterialFlow where Diagram.Project = &project
Find the messages of the project diagrams that describe an org-unit:
Select Diagram into @Org-UnitDiagram where Described-Org-Unit and Project = &project
Select Message where Diagram in @ DiagramOrg-Unit