SQL >> Base de Datos >  >> Database Tools >> SSMS

Combinar varias consultas TOP 1 con WITH TIES

WITH TIES permite obtener la primera fila por grupo sin self-join:

select top 1 with ties software, date from t order by row_number() over(partition by software order by date desc)

Trae empates incluidos.