忘了说表结构主要是两个表com, productcom的字段:
id
cnameproduct的字段:
id
com_id
cname
descriptions

解决方案 »

  1.   

    不能在客户端想办法么。如果是asp的话,ado就可以知道页数。
      

  2.   

    棕椰树
    select count(*)/16 from com;
      

  3.   

    谢谢大家!
    目前我是这样写这句SQL的
    select count(*) 
    from (
          select com.ID 
          from product,com  
          where product.com_id = com.ID
          group by com.ID 
          )
    统计出总记录数
    页数总算没有问题了
    但具体查询记录内容那句应该怎么写?
      

  4.   

    抛砖引玉 : 
      select com.ID,com.cname,product.id,product.descriptions,c.PAGES 
      from product,com ,
            (select floor(count(*)/16)+1 as PAGES from com) c
      where product.com_id = com.ID ;
      

  5.   

    select ceil(count(1)/16) from com