本文介绍了如何选择Max Checktime我错了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

select FullName,max(CheckTime),EmployeeAttendance.ActionType from dbo.EmployeeAttendance
 inner join EmployeeDetails on EmployeeDetails.EmployeeID=EmployeeAttendance.EmployeeID

 group by EmployeeAttendance.ActionType,FullName

推荐答案

select  a.AttendanceID,a.CheckTime,a.ActionType,b.FullName  from EmployeeAttendance a join EmployeeDetails b on a.EmployeeID=b.EmployeeID  where   AttendanceID  in (select top 1 AttendanceID from EmployeeAttendance b
where a.EmployeeID=b.EmployeeID order by AttendanceID desc)and a.ActionType='i'


这篇关于如何选择Max Checktime我错了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-20 14:07