Puedes probar ROW_NUMBER
, pero puede afectar su rendimiento.
;WITH CTE AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY a ORDER BY b) Corr
FROM my_table
)
SELECT *
FROM CTE
WHERE Corr = 1
Puedes probar ROW_NUMBER
, pero puede afectar su rendimiento.
;WITH CTE AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY a ORDER BY b) Corr
FROM my_table
)
SELECT *
FROM CTE
WHERE Corr = 1