Is there an existing issue for the same bug?
Branch Name
main
Commit ID
d096066
Other Environment Information
- Hardware parameters:
- OS type:
- Others:
Actual Behavior
drop database if exists percent_rank_func;
create database percent_rank_func;
use percent_rank_func;
drop table if exists test_pr_basic;
create table test_pr_basic (
id int primary key,
department varchar(50),
employee varchar(50),
salary decimal(10, 2)
);
insert into test_pr_basic values
(1, 'engineering', 'alice', 80000),
(2, 'engineering', 'bob', 90000),
(3, 'engineering', 'charlie', 90000),
(4, 'engineering', 'david', 100000),
(5, 'engineering', 'eve', 110000),
(6, 'sales', 'frank', 50000),
(7, 'sales', 'grace', 60000),
(8, 'sales', 'hank', 70000),
(9, 'hr', 'ivy', 65000),
(10, 'hr', 'jack', 65000);
select
department,
employee,
salary,
percent_rank() over (order by department, salary) as pct_rank
from test_pr_basic
order by department, salary;
drop table if exists test_pr_char;
create table test_pr_char (id int, val char(10));
insert into test_pr_char values (1, 'apple'), (2, 'banana'), (3, 'cherry'), (4, 'date');
select val, percent_rank() over (order by val) as pct_rank from test_pr_char order by val;
Expected Behavior
No response
Steps to Reproduce
Additional information
No response
Is there an existing issue for the same bug?
Branch Name
main
Commit ID
d096066
Other Environment Information
Actual Behavior
drop database if exists percent_rank_func;
create database percent_rank_func;
use percent_rank_func;
drop table if exists test_pr_basic;
create table test_pr_basic (
id int primary key,
department varchar(50),
employee varchar(50),
salary decimal(10, 2)
);
insert into test_pr_basic values
(1, 'engineering', 'alice', 80000),
(2, 'engineering', 'bob', 90000),
(3, 'engineering', 'charlie', 90000),
(4, 'engineering', 'david', 100000),
(5, 'engineering', 'eve', 110000),
(6, 'sales', 'frank', 50000),
(7, 'sales', 'grace', 60000),
(8, 'sales', 'hank', 70000),
(9, 'hr', 'ivy', 65000),
(10, 'hr', 'jack', 65000);
select
department,
employee,
salary,
percent_rank() over (order by department, salary) as pct_rank
from test_pr_basic
order by department, salary;
drop table if exists test_pr_char;
create table test_pr_char (id int, val char(10));
insert into test_pr_char values (1, 'apple'), (2, 'banana'), (3, 'cherry'), (4, 'date');
select val, percent_rank() over (order by val) as pct_rank from test_pr_char order by val;
Expected Behavior
No response
Steps to Reproduce
Additional information
No response