sql语句求助
select *from
(select Cwno,DeptName,Cdate ,Cseno,a.BatchCnt,Ctime,Etime
from GkjlL_His_His a
inner join
OPENDATASOURCE('SQLOLEDB','Data Source=172.17.240.93;User ID=sa;Password=!QAZ2wsx').pddbgz.dbo.[YwCk] e
on a.Cwno = e.Wno) a
where a.BatchCnt !='0' and DATEDIFF(S,Ctime,Etime)<5
GROUP BY DeptName,a.Cwno,Cdate ,Cseno,a.BatchCnt,Ctime,Etime
having Etime like '__:__:__'
--异常数据举例
select *
from
(select Cwno,DeptName,Cdate ,Cseno,a.BatchCnt,Ctime,Etime
from GkjlL_His_His a
inner join
OPENDATASOURCE('SQLOLEDB','Data Source=172.17.240.93;User ID=sa;Password=!QAZ2wsx').pddbgz.dbo.[YwCk] e
on a.Cwno = e.Wno) a
where a.BatchCnt !='0' and DATEDIFF(S,Ctime,Etime)<5
GROUP BY DeptName,a.Cwno,Cdate ,Cseno,a.BatchCnt,Ctime,Etime
having Etime is not null
以上两个语句为什么执行的结果不一样?求大神帮忙啊啊