我在与选择时,有一个“呼叫ID”列选择选择哪个行的SQL最大价值
在这种情况下的多个条目的单个行中的问题有被选择两行:
Assignee maxTime
Jim Smith 11:31:05
James Smith 17:50:16
我想只选择一个有最大时间的行。
输出我想:
Assignee maxTime
James Smith 17:50:16
这是我的代码:
select Assignee, MAX(TimeResolv) as maxTime
from heat8..asgnmnt
where callid ='00539265'
and GroupName like '%cs%'
Group by Assignee
帮助,将不胜感激。
您可以执行TOP 1和按最大时间排序desc – mxix
也可以显示样本表数据。 (给出指定结果的那个) – jarlh
这工作 - 谢谢你。 – obizues