Skip to content

Commit

Permalink
add order by
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangstar333 committed Oct 7, 2023
1 parent e96db51 commit a7c2af0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ aquamarine blue seashell 14

-- !select3 --
aquamarine blue peru 11
lace blue spring 11
indian coral smoke 11
lace blue spring 11

-- !select4 --
aquamarine blue peru 10
beige blanched thistle 10
indian coral seashell 10
bisque orange violet 10
lace blue midnight 10
beige forest white 10
bisque orange violet 10
blush frosted thistle 10
indian coral seashell 10
lace blue midnight 10

Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ suite("test_partition_sort") {
dense_rank() over(partition by p_name order by p_color) as dr from part) as t; """

qt_select2 """ select * from (
select p_name, p_color , row_number() over(partition by p_name order by p_color) as rn from part) as t where rn=14; """
select p_name, p_color , row_number() over(partition by p_name order by p_color) as rn from part) as t where rn=14 order by 1,2,3; """

qt_select3 """ select * from ( select p_name, p_color , rank() over(partition by p_name order by p_color) as rn from part) as t where rn=11; """
qt_select3 """ select * from ( select p_name, p_color , rank() over(partition by p_name order by p_color) as rn from part) as t where rn=11 order by 1,2,3; """

qt_select4 """ select * from ( select p_name, p_color , dense_rank() over(partition by p_name order by p_color) as rn from part) as t where rn=10; """
qt_select4 """ select * from ( select p_name, p_color , dense_rank() over(partition by p_name order by p_color) as rn from part) as t where rn=10 order by 1,2,3; """



Expand Down

0 comments on commit a7c2af0

Please sign in to comment.