2016-04-27 34 views
0

我有這個設置的結果,從表中的MySQL:SQL從列表中顯示不同的記錄

表例如:

enter image description here

是否有可能,如果我想要得到的結果是這樣的:

enter image description here

我只是想爲「輔助輸出:應答呼叫」的一個記錄,「輔助輸出:來電」之後。

提前致謝!

+2

你有什麼試過的?顯示一些代碼,其他人會根據你的方法擴展你的代碼 – Raghuveer

回答

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 
相關問題