Date_Local Name Value
2019-08-13 10:30:54.377 Ted 20
2019-08-13 10:30:54.377 Jake 50
2019-08-12 09:10:55.377 Ben 30
结果:-
预期结果是提取Ted和Jake数据行。
1 个答案:
答案 0 :(得分:0)
SELECT T.Date_Local,T.Name,T.value
FROM tbladata T
INNER JOIN
(
SELECT ROW_NUMBER() OVER(PARTITION BY Date_Local ORDER BY Date_Local) as rowNum,
Name,
Value,
Date_Local
FROM tblaData
) AS sub ON(T.Date_Local=sub.Date_Local)
WHERE sub.rowNum>1