SQL Distinct

Handian Sudianto 6,096 Reputation points
2024-07-18T07:22:49.09+00:00

Hello,

I have record like below pic and need to filter so the output only have one record for each NodeID and sort by InstallDate. How I can do this by SQL?

User's image

SQL Server Other
0 comments No comments
{count} votes

Accepted answer
  1. Olaf Helper 47,436 Reputation points
    2024-07-18T07:49:41.5566667+00:00

    You can use an aggregation, like

    SELECT NodeID, MIN(InstallDate) AS MinInstallDate
    FROM yourTable
    GROUP BY NodeID
    ORDER BY MinInstallDate
    
    

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.