日期:2014-05-17 浏览次数:20458 次
select fUserID,fChapterID ,fScore,fIsPassed
from TestRecord
where CONVERT(varchar(100), fTime, 120) = CONVERT(varchar(100), GETDATE(), 120)
and fUserID not in (select fUserID from TestRecord where fIsPassed = 1 and CONVERT(varchar(100), fTime, 120) <> CONVERT(varchar(100), GETDATE(), 120))--1是及格
select fUserID,fChapterID ,fScore,fIsPassed from TestRecord where
CONVERT(varchar(100), fTime, 120) = CONVERT(varchar(100), GETDATE(), 120) and
fUserID not in
(select a.fUserID
from
(
select fUserID,fChapterID ,fScore,fIsPassed from TestRecord where CONVERT(varchar(100), fTime, 120) = CONVERT(varchar(100), GETDATE(), 120)
) a ,
(
select fUserID,fChapterID ,fScore,fIsPassed from TestRecord where CONVERT(varchar(100), fTime, 120) <> CONVERT(varchar(100), GETDATE(), 120)
) b
where a.fChapterID =b.fChapterID and a.fUserID=b.fUserID
)