Add SqlFunc.Rank

This commit is contained in:
sunkaixuan 2024-02-13 12:39:42 +08:00
parent 8b0281fd22
commit ce013315e4
2 changed files with 12 additions and 0 deletions

View File

@ -70,6 +70,16 @@ namespace SqlSugar
{
throw new NotSupportedException("Can only be used in expressions");
}
public static int Rank(object orderByField, object partitionBy)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static int Rank(object orderByField)
{
throw new NotSupportedException("Can only be used in expressions");
}
public static int RowCount(object countFiledName,object orderByField, object partitionBy)
{
throw new NotSupportedException("Can only be used in expressions");

View File

@ -909,6 +909,8 @@ namespace SqlSugar
return this.Context.DbMehtods.Stuff(model);
case "RowNumber":
return this.Context.DbMehtods.RowNumber(model);
case "Rank":
return this.Context.DbMehtods.RowNumber(model).Replace("row_number() over(", " rank() over(");
case "RowCount":
return this.Context.DbMehtods.RowCount(model);
case "RowSum":