Vous pouvez essayer ROW_NUMBER
, mais cela peut affecter vos performances.
;WITH CTE AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY a ORDER BY b) Corr
FROM my_table
)
SELECT *
FROM CTE
WHERE Corr = 1
Vous pouvez essayer ROW_NUMBER
, mais cela peut affecter vos performances.
;WITH CTE AS
(
SELECT *, ROW_NUMBER() OVER(PARTITION BY a ORDER BY b) Corr
FROM my_table
)
SELECT *
FROM CTE
WHERE Corr = 1