# S02030 {#s02030}

## Error Code {#error_code .section}

S02030

## Error Message {#error_message .section}

`Function toArray cannot be used with PIVOT BY. RefId:S02030`

## Probable Causes {#probable_causes .section}

The `toArray` function is not allowed to be used with PIOVT BY.

For example:

``` {#codeblock_c5f_sx5_1bc}
n = 10000
id = take(1..10, n)
value = take(1..10, n)
t = table(id, value)

select toArray(id) from t pivot by id, value // throw exception
```

## Solutions {#solutions .section}

Avoid using `toArray` when querying with a PIVOT BY clause.

**Parent topic:**[Error Code Reference](../../Troubleshooting/ErrorCode.md)

