select top 10 
a.h_id,
a.h_name,
a.h_writer,
pub_name = dbo.uf_getPubName(a.pub_id),
a.h_output_price,
a.h_smallimage,
a.h_publish_date,
discount_price =CONVERT(decimal(10, 2),(db_product_discount.h_output_discount_ls*a.h_output_price))
from (select *
from db_product b
where b.h_id not in(
select top 20 
db_product.h_id
from db_product,
db_publishs,
db_product_discount
where db_product.pub_id=db_publishs.pub_id 
AND db_product.h_id=db_product_discount.h_id 
AND db_product.h_type='0707')) a,db_product_discount
where a.h_id=db_product_discount.h_id不能分页显示,我点每一页显示的数据怎么一样呢

解决方案 »

  1.   

    SQL写得有问题吧~~
    你查出来的都是最前10条数据,页面上自然显示不出来的。
      

  2.   

    你sql写的不对阿,每次都是查一样的东西。自然都一样了啊
      

  3.   

    可以用存储过程,具体参考:
    http://www.cnblogs.com/kasafuma/archive/2005/08/04/207481.html
      

  4.   

    可是我是在...where b.h_id not in(
    select top 20....
    进行筛选的,也就是先去掉前20条数据,然后再取前10条。
    要不帮我改改吧,我实在不知道怎么改了,谢谢
      

  5.   

    不用存储过程,但是类似的方法
    http://dwp008.cnblogs.com/archive/2005/09/16/238571.html