Queryable.Distinct().Select(exp,true)

This commit is contained in:
sunkaixuan
2023-10-18 15:12:01 +08:00
parent 7ce9bf3e8b
commit 86efdc3efd

View File

@@ -811,7 +811,7 @@ namespace SqlSugar
{ {
this.SelectCacheKey = this.SelectCacheKey + string.Join("-", this._JoinQueryInfos.Select(it => it.TableName)); this.SelectCacheKey = this.SelectCacheKey + string.Join("-", this._JoinQueryInfos.Select(it => it.TableName));
} }
if (IsDistinct) if (IsDistinct&&result?.StartsWith("DISTINCT ")!=true)
{ {
result = " DISTINCT " + result; result = " DISTINCT " + result;
} }