select *
from employee
where id not in(select id from cowa)
and id not in(select id from cowa where stuff(convert varchar(20),date,120),1,10,'')='2005-10-15')
from employee
where id not in(select id from cowa)
and id not in(select id from cowa where stuff(convert varchar(20),date,120),1,10,'')='2005-10-15')
select * from employee where id not in (select id from COWA )
查询考勤表中2005-10-15早上没到的员工信息
select * from employee where id not in (select id from COWA where datediff(dd,date,'2005-10-15')=0)
select * from employee where id not in (select id from COWA where datediff(dd,date,'2005-10-15')=0 and datediff(hh,date,'2005-10-15 12:00:00')>=0)