0
SELECT ID, Checktime, Checktype
  FROM (SELECT ID,Checktime as Date_IN,Checktype as CheckIn
FROM OT 
  WHERE Checktype='I')  AS TimeIN
Left join
  (SELECT ID  as Emp_Out_ID,Checktime as Date_Out,Checktype as CheckOut
From OT
Where Checktype="O"
group by Emp_Out_ID) as [TimeOut]
on (TimeIN.ID <> TimeOut.Emp_Out_ID
and TimeIN.ID = TimeOut.Emp_Out_ID
group by ID;

我正在尝试过滤掉结果

我在这里做错了什么?

4

0 回答 0