mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-05 15:55:57 +03:00
Fix a problem with handling single row partitions in the percent_rank() window
function. FossilOrigin-Name: b84fbf16eac718c151731e2b2dcc73f2f2a144e3670f8566a30793f1e4e6a3ec
This commit is contained in:
@@ -279,7 +279,7 @@ static void percent_rankValueFunc(sqlite3_context *pCtx){
|
||||
double r = (double)(p->nValue-1) / (double)(p->nTotal-1);
|
||||
sqlite3_result_double(pCtx, r);
|
||||
}else{
|
||||
sqlite3_result_double(pCtx, 100.0);
|
||||
sqlite3_result_double(pCtx, 0.0);
|
||||
}
|
||||
p->nValue = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user