MSSQL query boundaries conditions
SELECT Max(Id) nt
FROM (SELECT Id,(Ntile(160) over( ORDER BY Id)) nt FROM demo)
test
GROUP BY nt
ORDER BY nt
option (maxDOP 1024)
SELECT Max(Id) nt
FROM (SELECT Id,(Ntile(160) over( ORDER BY Id)) nt FROM demo)
test
GROUP BY nt
ORDER BY nt
option (maxDOP 1024)