select top 12 * from Product where [id] not in (select top 12 [id] from Product) 这样可以分页,但是我在后面想加个条件 select top 12 * from Product where [id] not in (select top 12 [id] from Product) where productid=34 分页就失效了 数据全是前12条是用什么控件分页显示数据,有些控件不是自带分页功能么. 改成 SQL code: select top 12 * from Product where [id] not in (select top 12 [id] from Product where productid=34) and productid=34
顶这个 楼主的SQL语句里面少了个条件 谢了 解决了 呵呵 确实是少了个条件 select top 12 * from Product where [id] not in (select top 12 [id] from Product) where productid=34,应该考虑执行顺序。 SQL code: select top 12 * from Product where [id] not in (select top 12 [id] from Product) and productid=34
或者SQL code: select top 12 * from Product where [id] not in (select top 12 [id] from Product where productid=34)