for and let clauses compared
Although for and let clauses both bind variables, the manner in which variables are bound is different.
The following table provides examples that compare the results that are returned by FLWOR expressions that contain similar for and let clauses.
Description of query | FLWOR expression | Result |
---|---|---|
Bind a single variable using for |
|
|
Bind a single variable using let |
|
|
Bind multiple variables using for |
|
|
Bind multiple variables using let |
|
|
Note: Because the
expressions in this table do not include order by clauses,
the order of the output elements is non-deterministic.
|