diff --git a/src/client/src/tscSQLParser.c b/src/client/src/tscSQLParser.c index 1828cda348d0140cce35a648e3e86d05d61c7442..08e4fecca2b4064f0eb90b1c8af05ecd3f6e2650 100644 --- a/src/client/src/tscSQLParser.c +++ b/src/client/src/tscSQLParser.c @@ -2759,7 +2759,7 @@ int32_t addExprAndResultField(SSqlCmd* pCmd, SQueryInfo* pQueryInfo, int32_t col if (pItem->pNode->Expr.paramList == NULL || (functionId != TSDB_FUNC_LEASTSQR && functionId != TSDB_FUNC_DERIVATIVE && functionId != TSDB_FUNC_ELAPSED && numOfParams != 1) || ((functionId == TSDB_FUNC_LEASTSQR || functionId == TSDB_FUNC_DERIVATIVE) && numOfParams != 3) || - (functionId == TSDB_FUNC_ELAPSED && numOfParams > 2)) { + (functionId == TSDB_FUNC_ELAPSED && numOfParams != 1 && numOfParams != 2)) { return invalidOperationMsg(tscGetErrorMsgPayload(pCmd), msg2); }