diff --git a/Src/Asp.Net/SqlSugar/Realization/Dm/SqlBuilder/DmQueryBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Dm/SqlBuilder/DmQueryBuilder.cs index dfc97ac19..bf530a475 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Dm/SqlBuilder/DmQueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Dm/SqlBuilder/DmQueryBuilder.cs @@ -49,6 +49,10 @@ namespace SqlSugar } this.OrderByValue = oldOrderBy; result = GetSqlQuerySql(result); + if (result.IndexOf("-- No table") > 0) + { + return "-- No table"; + } return result; } public override string ToPageSql(string sql, int? take, int? skip, bool isExternal = false) diff --git a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteQueryBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteQueryBuilder.cs index 29a466764..474caac94 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteQueryBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteQueryBuilder.cs @@ -62,6 +62,10 @@ namespace SqlSugar } this.OrderByValue = oldOrderBy; result = GetSqlQuerySql(result); + if (result.IndexOf("-- No table") > 0) + { + return "-- No table"; + } return result; }