Du kan prova ROW_NUMBER
, men det kan påverka din prestation.
;WITH CTE AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY a ORDER BY b) Corr
FROM my_table
)
SELECT *
FROM CTE
WHERE Corr = 1
Du kan prova ROW_NUMBER
, men det kan påverka din prestation.
;WITH CTE AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY a ORDER BY b) Corr
FROM my_table
)
SELECT *
FROM CTE
WHERE Corr = 1