Query to return 1 instance of a record with duplicates

前端 未结 6 1308
耶瑟儿~
耶瑟儿~ 2020-12-11 22:36

INFO: I am working with Microsoft SQL.
Ok the title is confusing but here is an example of the table I\'m working with:

ID    Value    Signal    Read             


        
6条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 23:19

    SELECT Id, Value, Signal, Read, Firmware, Date, Time FROM table_name t1 WHERE t1.Id = (SELECT DISTINCT t2.Id FROM table_name t2)
    

    Assuming that there is a check so that records with the same Id also have same Value

提交回复
热议问题