diff --git a/src/query/src/qExecutor.c b/src/query/src/qExecutor.c index 24a0a2394c999d90838b8677f89f1d8b09d8ec81..3e405c6c924a062a8cd0c5571aabaa4ee4befca1 100644 --- a/src/query/src/qExecutor.c +++ b/src/query/src/qExecutor.c @@ -4608,7 +4608,7 @@ SArray* getOrderCheckColumns(SQueryAttr* pQuery) { SSqlExpr* pExpr = &pQuery->pExpr1[j].base; int32_t functionId = pExpr->functionId; - if (index->colId == pExpr->colInfo.colId && (functionId == TSDB_FUNC_PRJ || functionId == TSDB_FUNC_TAG)) { + if (index->colId == pExpr->colInfo.colId && (functionId == TSDB_FUNC_PRJ || functionId == TSDB_FUNC_TAG || functionId == TSDB_FUNC_TS)) { index->colIndex = j; index->colId = pExpr->resColId; }