Hive 分页查询
select *
from
(
select
row_number() over (
order by
a.project_id) as rnum,
a.*
from
(
select
c.project_id,
sum(d.fav_price) as fee,
max(c.city) as city
from
henan841.wy_access_data_m c,
henan841.mss_jssj_new_m d
where
c.month_id = '202012'
and substr(c.project_id,0,4)='20HA'
and substr(c.online_time,0,4)='2020'
and c.user_id <>''
and d.month_id in (
'202001','202002','202003','202004','202005', '202006','202007','202008','202009','202010', '202011','202012'
)
and c.user_id = d.acc_nbr
group by
c.project_id
)a
)t
where t.rnum between 1 and 1000在这里插入代码片