Commit d2214da4 authored by Varun Gupta's avatar Varun Gupta

Test case added for the percentile disc function

parent ba9fbc6a
CREATE TABLE student (name CHAR(10), test double, score TINYINT);
INSERT INTO student VALUES
('Chun', 0, null), ('Chun', 0, 4),
('Esben', 1, null), ('Esben', 1, null),
('Kaolin', 0.5, 56), ('Kaolin', 0.5, 88),
('Tatiana', 0.8, 2), ('Tatiana', 0.8, 1);
select name, percentile_disc(0.6) within group(order by score) over (partition by name) from student;
select name, percentile_disc(test) within group(order by score) over (partition by name) from student;
select name, percentile_disc(0.4) within group(order by score) over (partition by name) from student;
#select name, percentile_cont(null) within group(order by score) over (partition by name) from student;
#select name, cume_dist() over (partition by name order by score) from student;
#normal parsing
#select percentile_cont(0.5) within group(order by score) over w1 from student
#window w1 AS (partition by name);
# no partition clause
#select percentile_cont(0.5) within group(order by score) over () from student;
# only one sort allowed
#select percentile_cont(0.5) within group(order by score) over (partition by name);
#parameter value should be in the range of 0 to 1
#select percentile_cont(1.5) within group(order by score) over (partition by name);
#
#select rank() over (partition by name order by score ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) from student;
drop table student;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment