SELECT TOP 20 * FROM QuestionTable as a WHERE (a.CurrentState='发布' or a.CurrentState='关注') and QuestionTypeCode in('DiannaoChangshi') and a.QuestionID >(SELECT ISNULL(MAX(a.QuestionID),0) FROM (SELECT TOP (20*1-20) a.QuestionID FROM QuestionTable as a WHERE (a.CurrentState='发布' or a.CurrentState='关注') and QuestionTypeCode in('DiannaoChangshi') and 1=1 ORDER BY a.QuestionID) A ) ORDER BY a.QuestionIDsql2005的语句 麻烦各位了!
FROM QuestionTable as a
WHERE (a.CurrentState='发布' or a.CurrentState='关注') and QuestionTypeCode in('DiannaoChangshi')
and a.QuestionID >(SELECT ISNULL(MAX(a.QuestionID),0)
FROM (SELECT TOP (20*1-20) a.QuestionID
FROM QuestionTable as a
WHERE (a.CurrentState='发布' or a.CurrentState='关注')
and QuestionTypeCode in('DiannaoChangshi')
and 1=1 ORDER BY a.QuestionID) A
)
ORDER BY a.QuestionID
(a.CurrentState='发布' or a.CurrentState='关注')
and QuestionTypeCode in('DiannaoChangshi')
and a.QuestionID >(
SELECT ISNULL(MAX(a.QuestionID),0) FROM
(SELECT TOP (20*1-20) a.QuestionID FROM QuestionTable as a WHERE
(a.CurrentState='发布' or a.CurrentState='关注')
and QuestionTypeCode in('DiannaoChangshi')
and 1=1 ORDER BY a.QuestionID
) A
) ORDER BY a.QuestionID
语法没问题