SQL Distinct

Handian Sudianto 6,541 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

Answer accepted by question author
  1. Olaf Helper 47,581 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' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.