谢谢大家! 目前我是这样写这句SQL的 select count(*) from ( select com.ID from product,com where product.com_id = com.ID group by com.ID ) 统计出总记录数 页数总算没有问题了 但具体查询记录内容那句应该怎么写?
抛砖引玉 : 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 ;
select count(*)/16 from com;
目前我是这样写这句SQL的
select count(*)
from (
select com.ID
from product,com
where product.com_id = com.ID
group by com.ID
)
统计出总记录数
页数总算没有问题了
但具体查询记录内容那句应该怎么写?
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 ;