目前正在将我的 Oracle 查询迁移到 MariaDB 10.4
我在分析功能方面遇到了困难。
MARIADB 代码:
select cgi, timestamp, hour, rat_type, dl_tput,
ntile(24) over (partition by timestamp,rat_type order by dl_tput) as dl_tput_ntiled
from (select cgi, date(timestamp) as timestamp,
date_format(timestamp,'%H') as hour, rat_type, avg(avg_mean_down) as dl_tput
from JUST_TEST_A
where avg_mean_down is not null
group by cgi, date(timestamp),date_format(timestamp,'%H'),rat_type
) x ;
此代码工作正常,但在验证输出后,Oracle 的结果与 MariaDB 的结果不同(数据相同)
我的 oracle 脚本有这个我在 mariadb 中删除的脚本。
select cgi, timestamp, hour, rat_type, dl_tput,
ntile(24) over (partition by timestamp,rat_type order by dl_tput) as dl_tput_ntiled,
count(*) over () as dl_tput_cnt
from (...)
count(*) over ()
会影响我的输出吗?这个分析函数的 MariaDB 的替代查询是什么?