# `let …​ =` statement

The statement `let <VAR> = <EXPRESSION>` assigns the result of a single valued expression `<EXPRESSION>` to the variable `<VAR>`.

The expression can be a literal, an arithmetic expression, or a single valued function call.

If the function returns a tuple, multiple variables must be specified on the left hand side of the assignment.

Schema for the following examples

```typeql
#!test[schema, commit]
define
fun minmax($a: integer, $b: integer) -> integer, integer:
match
{ $a <= $b; let $min = $a; let $max = $b; } or
{ $a > $b; let $min = $b; let $max = $a; };
return first $min, $max;
```

```typeql
#!test[read]
match
  let $x, $y = minmax(3 * 5, 4 * 4);
```

[is](../is/index.md) [let …​ in](../let-in/index.md)

[Edit on GitHub](https://github.com/typedb/typedb-docs/edit/3.x-development/typeql-reference/modules/ROOT/pages/statements/let-eq.adoc) Edit this page on GitHub.