TOP n [PERCENT]n 指定返回的行数。如果未指定 PERCENT,n 就是返回的行数。如果指定了 PERCENT,n 就是返回的结果集行的百分比,如下所示:TOP 120 /*Return the top 120 rows of the result set. */
TOP 15 PERCENT /* Return the top 15% of the result set. */.
TOP 15 PERCENT /* Return the top 15% of the result set. */.
FROM test
WHERE (testCourse = @courseId) and (pub = 1)
AND (typeofproblem = @type)";
FROM test
WHERE testCourse = @courseId and pub = 1
AND typeofproblem = @type";
也没有必要要括号。只能用变量值