mirror of
https://github.com/dotnetcore/FreeSql.git
synced 2026-02-07 00:40:55 +08:00
- 修复 WithTempQuery+AsTreeCte 生成SQL错误;#2080
This commit is contained in:
@@ -893,6 +893,7 @@ JOIN {select._commonUtils.QuoteSqlName(tbDbName)} a ON cte_tbc.cte_id = a.{selec
|
||||
select._where.Clear();
|
||||
select.As("wct2");
|
||||
var sql2Field = select.GetAllFieldExpressionTreeLevel2(false).Field;
|
||||
if (sql2Field == "*") sql2Field = "wct2.*";
|
||||
var sql2InnerJoinOn = up == false ?
|
||||
string.Join(" and ", tbref.Columns.Select((a, z) => $"wct2.{select._commonUtils.QuoteSqlName(tbref.RefColumns[z].Attribute.Name)} = wct1.{select._commonUtils.QuoteSqlName(a.Attribute.Name)}")) :
|
||||
string.Join(" and ", tbref.Columns.Select((a, z) => $"wct2.{select._commonUtils.QuoteSqlName(a.Attribute.Name)} = wct1.{select._commonUtils.QuoteSqlName(tbref.RefColumns[z].Attribute.Name)}"));
|
||||
|
||||
Reference in New Issue
Block a user