日期:2014-05-18 浏览次数:20542 次
SELECT u.VIDEO_ID FROM T_USER_LEARNING_RECORD AS u , dbo.T_VIDEO AS v WHERE u.VIDEO_ID = v.VIDEO_ID AND u.LEARNING_TIME >= v.TIME_LENGTH AND u.USER_ID = @user_id SELECT VIDEO_ID FROM dbo.T_VIDEO WHERE COURSE_ID=@course_id
SELECT CASE COUNT(1) WHEN 0 THEN 'true' ELSE 'false' END AS Ifcontain FROM T_USER_LEARNING_RECORD AS u , dbo.T_VIDEO AS v WHERE u.VIDEO_ID = v.VIDEO_ID AND u.LEARNING_TIME >= v.TIME_LENGTH AND u.USER_ID = @user_id AND EXISTS (SELECT 1 FROM dbo.T_VIDEO AS A WHERE COURSE_ID=@course_id AND A.VIDEO_ID <> v.VIDEO_ID)