diff --git a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubGroupBy.cs b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubGroupBy.cs index b130d17db..a7a9113e9 100644 --- a/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubGroupBy.cs +++ b/Src/Asp.Net/SqlSugar/ExpressionsToSql/Subquery/Items/SubGroupBy.cs @@ -69,6 +69,10 @@ namespace SqlSugar var selfParameterName = this.Context.GetTranslationColumnName((argExp as LambdaExpression).Parameters.First().Name) + UtilConstants.Dot; if (this.Context.JoinIndex == 0) result = result.Replace(selfParameterName, SubTools.GetSubReplace(this.Context)); + if (this.Context.CurrentShortName == null) + { + this.Context.CurrentShortName =this.Context.GetTranslationColumnName(ExpressionTool.GetParameters(exp).FirstOrDefault().Name); + } return result; } }