> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8a08bda2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Documentation describing the APPLY modifier which allows you to invoke some function for each row returned by an outer table expression of a query.

# APPLY modifier

> Allows you to invoke some function for each row returned by an outer table expression of a query.

<h2 id="syntax">
  Syntax
</h2>

```sql theme={null}
SELECT <expr> APPLY( <func> ) FROM [db.]table_name
```

<h2 id="example">
  Example
</h2>

```sql theme={null}
CREATE TABLE columns_transformers (i Int64, j Int16, k Int64) ENGINE = MergeTree ORDER by (i);
INSERT INTO columns_transformers VALUES (100, 10, 324), (120, 8, 23);
SELECT * APPLY(sum) FROM columns_transformers;
```

```response theme={null}
┌─sum(i)─┬─sum(j)─┬─sum(k)─┐
│    220 │     18 │    347 │
└────────┴────────┴────────┘
```
