Browse Source

Rownumber function has multiple fields

SqlSugar5
sunkaixuan 2 years ago
parent
commit
89947e6f3b
  1. 4
      Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs

4
Src/Asp.Net/SqlSugar/ExpressionsToSql/DbMethods/DefaultDbMethod.cs

@ -12,11 +12,11 @@ namespace SqlSugar
{
if (model.Args.Count == 1)
{
return $"row_number() over(order by {model.Args[0].MemberName})";
return $"row_number() over(order by {model.Args[0].MemberName.ObjToString().TrimEnd('\'').TrimStart('\'')})";
}
else
{
return $"row_number() over( partition by {model.Args[1].MemberName} order by {model.Args[0].MemberName})";
return $"row_number() over( partition by {model.Args[1].MemberName.ObjToString().TrimEnd('\'').TrimStart('\'')} order by {model.Args[0].MemberName.ObjToString().TrimEnd('\'').TrimStart('\'')})";
}
}
public virtual string RowCount(MethodCallExpressionModel model)

Loading…
Cancel
Save