如何从我的Id中创建每一行?

时间:2017-02-08 06:40:49

标签: sql-server database

这是我的数据库结果图片:

enter image description here

2 个答案:

答案 0 :(得分:0)

使用Row_number,您可以获得ID的第一行

Select * from (
        Select *,
    Row_number()OVER(PARTITION BY ID ORDER BY (SELECT NULL))RN 
From Your Table )T 
Where T.RN = 1 

答案 1 :(得分:0)

Select Id,Label,Score,Flag,AutoGenId from (
   Select *,
   Row_number()OVER(PARTITION BY ID ORDER BY (SELECT NULL))RN
From [VisionApiResponseData] )T
Where T.RN = 1