I have a query that returns the following data
as you can see in the image, the colored groups are similar to the "A" columns. I want to take the first occurrence of these lines relative to the "A" column and discard the rest.
so I can finish this result.
any solutions?
Thank:)
Update:
these are the original query results
I would do it like this:
WITH T(A, B, C, D, RowNum) AS ( SELECT A, B, C, D, ROW_NUMBER() OVER (PARTITION BY A ORDER BY A) FROM MyTable ) SELECT * FROM T WHERE RowNum = 1