MaCH repo
This commit is contained in:
5
07_roundest_pokemon_htmx/get_results.sql
Normal file
5
07_roundest_pokemon_htmx/get_results.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
select id, name, sprite, wins, loses,
|
||||
cast(wins as real) / nullif(loses, 0) as ratio_of_wins_to_loses,
|
||||
row_number() over (order by (cast(wins as real) / nullif(loses, 0)) desc) as rank
|
||||
from pokemons
|
||||
order by ratio_of_wins_to_loses desc;
|
||||
Reference in New Issue
Block a user