diff --git a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs index 3c9b33245..e9b0ed5a0 100644 --- a/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs +++ b/Src/Asp.Net/SqlSugar/Abstract/DeleteProvider/DeleteableProvider.cs @@ -226,6 +226,11 @@ namespace SqlSugar var expResult = DeleteBuilder.GetExpressionValue(expression, ResolveExpressType.WhereSingle); var whereString = expResult.GetResultString(); if (expression.ToString().Contains("Subqueryable()")) { + if (ExpressionTool.GetParameters(expression).First().Type == typeof(T)) + { + var tableName = this.SqlBuilder.GetTranslationColumnName(this.EntityInfo.DbTableName); + whereString = whereString.Replace(tableName, $"( SELECT * FROM {tableName}) "); + } whereString = whereString.Replace(this.SqlBuilder.GetTranslationColumnName(expression.Parameters.First().Name) + ".", this.SqlBuilder.GetTranslationTableName(this.EntityInfo.DbTableName) + "."); } else if (expResult.IsNavicate)