SELECT TOP 页大小 * <br>FROM TestTable <br>WHERE (ID > <br>(SELECT MAX(id) <br>FROM (SELECT TOP 页大小*页数 id <br>FROM 表 <br>ORDER BY id) AS T)) <br>ORDER BY ID
ro gulang: 我在sql查询分析器里测<br><br><br>SELECT TOP 10 * <br>FROM msg <br>WHERE (ID > <br>(SELECT MAX(id) <br>FROM (SELECT TOP 10*2 id <br>FROM 表 <br>ORDER BY id) AS T)) <br>ORDER BY ID <br><br>有个错误:“第 7 行: '2' 附近有语法错误。”
我刚试过的,针对pubs库中jobs表<br>SELECT TOP 5 * <br>FROM jobs <br>WHERE (job_id > <br>(SELECT MAX(job_id) <br>FROM (SELECT TOP 10 job_id <br>FROM jobs <br>ORDER BY job_id) AS T)) <br>ORDER BY job_id