保留第一条及最后一条:
DELETE tblAttendRecord.ID, tblAttendRecord.*
FROM tblAttendRecord
WHERE (((tblAttendRecord.ID) Not In (SELECT Min(tblAttendRecord.ID) AS ID之最小值
FROM tblAttendRecord
GROUP BY tblAttendRecord.KQNO;) And (tblAttendRecord.ID) Not In (SELECT Max(tblAttendRecord.ID) AS ID之最大值
FROM tblAttendRecord
GROUP BY tblAttendRecord.KQNO;)));