SELECT row_num ,
product_num ,
pol_pdid
FROM ( SELECT ROW_NUMBER() OVER ( ORDER BY pol_pdid ) row_num ,
COUNT(1) product_num ,
pol_pdid
FROM PRODUCT_OPERATE_LOG
WHERE 1 = 1
GROUP BY pol_pdid
) b
WHERE row_num BETWEEN 1 AND 2
sqlserver 汇总后的数据分页查询
最新推荐文章于 2024-08-21 11:29:11 发布
该篇文章展示了如何使用SQL查询从PRODUCT_OPERATE_LOG表中按pdid分组,并获取每个pdid的行号和产品数量,特别关注了前两行的数据。
摘要由CSDN通过智能技术生成