diff --git a/src/client/src/tscSubquery.c b/src/client/src/tscSubquery.c index 07de0cf3ee8626fa5a7fff8ccf8de003f47ebb88..aefec7dc9df032f16639fe415a0541e57b93fa3a 100644 --- a/src/client/src/tscSubquery.c +++ b/src/client/src/tscSubquery.c @@ -3922,7 +3922,9 @@ void* createQInfoFromQueryNode(SQueryInfo* pQueryInfo, STableGroupInfo* pTableGr } else if (pQueryAttr->pExpr2 != NULL) { pEx = pQueryAttr->pExpr2; num = pQueryAttr->numOfExpr2; - } else { + } + + if ( num < pQueryAttr->numOfOutput) { pEx = pQueryAttr->pExpr1; num = pQueryAttr->numOfOutput; }