【发布时间】:2017-07-09 11:46:35
【问题描述】:
谁能告诉我如何在 oracle 中实现这个查询
select column1, columns2, max(rownumber) from table where .....;
说明:Select Query 非常复杂,我需要 max 给 UI 端记录的“总计数”以进行分页,我将根据分页大小而不是完整记录仅发送 20 或 30 条记录。
【问题讨论】:
谁能告诉我如何在 oracle 中实现这个查询
select column1, columns2, max(rownumber) from table where .....;
说明:Select Query 非常复杂,我需要 max 给 UI 端记录的“总计数”以进行分页,我将根据分页大小而不是完整记录仅发送 20 或 30 条记录。
【问题讨论】:
使用窗口函数:
select column1, columns2,
count(*) over () as total_count
from table
where .....;
【讨论】: