---
source_url: https://docs.dolphindb.cn/zh/error_codes/S02031.html
fetched_at: 2026-05-19T09:09:47Z
category: error_codes
title: S02031
sha1: 8459d79801b5b8b270c210593c97b57ecab55299
---

# S02031

## 错误代码

S02031

## 报错信息

Only one parameter can be passed to null-filling operation [xxx] when it is used with
PIVOT BY. RefId:S02031

## 错误原因

在 pivot by 查询中，select 子句不支持使用多于1个参数的 ffill, bfill, lfill 函数。否则，会出现该报错。见下例：

```dolphindb
sym = `C`MS`MS`MS`IBM`IBM`C`C`C
price= [49.6, 29.46, 29.52, 30.02, 174.97, 175.23, 50.76, 50.32, 51.29]
qty = [2200, 1900, 2100, , 6800, 5400, 1300, 2500, 8800]
timestamp = [09:34:07,09:35:42,09:36:51,09:36:59,09:35:47,09:36:26,09:34:16,09:35:26,09:36:12]
t = table(timestamp, sym, qty, price);

select ffill(qty) from t pivot by sym, timestamp // allow
select ffill(qty, 1) from t pivot by sym, timestamp // error
```

## 解决方案

重写脚本逻辑。
