Percentile_cont and Percentile_disc are all designed to calculate percentile values, such as calculating the number of a field at a percentile. Their difference is that the former is continuous type, the latter is discrete type. Cont represents CONTINUOUS,DISC on behalf of discrete. Percentile_cont is continuous, meaning that it considers the interval, so the value is the absolute middle value. The Percentile_disc is discrete, so it takes more of an upward or downward tradeoff without considering the interval. Here's an example of MSDN:
UseAdventureWorks2012; SELECT DISTINCTName asDepartmentname, Percentile_cont (0.5) withinGROUP(ORDER byPh. Rate) Over(PARTITION byName) asMediancont, Percentile_disc (0.5) withinGROUP(ORDER byPh. Rate) Over(PARTITION byName) asMediandisc fromHumanResources.Department asDINNER JOINHumanresources.employeedepartmenthistory asDH onDh. DepartmentID=D.departmentidINNER JOINHumanresources.employeepayhistory asph onPh. BusinessEntityID=DH. BusinessEntityIDWHEREDh. EndDate is NULL;
Percent_rank, though also with PERCENT, has nothing to do with the first two. It is in order to calculate the current value as a percentage of the percentile position.
Reference:
PERCENTILE_CONT (Transact-SQL)
PERCENTILE_DISC (Transact-SQL)
PERCENT_RANK (Transact-SQL)
SQL Server->> Percentile_cont, Percentile_disc, and Percent_rank functions