标签: mysql sql
我从MySQL中的表中获得了这组结果:
表示例:
如果我希望结果如下:
在Aux Out:来电之后,我只想要一个'Aux Out:Answer Call'的记录。
提前致谢!
答案 0 :(得分:0)
请尝试此查询。
with cte as ( select row_number() over (partition by convert(varchar(10),TimeStamp,20),Activity order by PK_EmployeeLog) as rid,* from @table ) select * from cte where rid=1