Answers for "choose only one for each distinct collumn regardless of other columns"

SQL
0

choose only one for each distinct collumn regardless of other columns

WITH cte AS
(   SELECT *, ROW_NUMBER() OVER (PARTITION BY id ORDER BY val1 DESC) AS rn
    FROM MyTable
)
SELECT *
FROM cte
WHERE rn = 1
Posted by: Guest on January-25-2022

Code answers related to "choose only one for each distinct collumn regardless of other columns"

Code answers related to "SQL"

Browse Popular Code Answers by Language