This commit is contained in:
Denny Crane 2022-09-16 19:54:40 -03:00
parent 7e6fee46d1
commit bc4e08662d
2 changed files with 8 additions and 0 deletions

View File

@ -0,0 +1,3 @@
0 1
-2 2
-2 2

View File

@ -0,0 +1,5 @@
SELECT round((countIf(rating = 5)) - (countIf(rating < 5)), 4) as nps,
dense_rank() OVER (ORDER BY nps DESC) as rank
FROM (select number as rating, number%3 rest_id from numbers(10))
group by rest_id
order by rank;