Baselight
SELECT 
  "country_larger_city" AS "country", 
  "larger_city" AS "city", 
  "pop_larger_city" AS "population_city", 
  SUM("pop_smaller_city") AS "population_reachable",
  ROUND(SUM("pop_smaller_city") / "pop_larger_city",2) AS "population_ratio",
  RANK() OVER (ORDER BY "population_reachable" DESC) AS "rank"
FROM "@esifunds.bp5k_ynxy.table_1"
WHERE "time_opti" <= 120
GROUP BY "country", "city", "population_city"
ORDER BY "population_reachable" DESC
LIMIT 10
countrycitypopulation_citypopulation_reachablepopulation_ratiorank
UKLondon8716900124030491.421
UKBirmingham238068395748574.022
UKGreater Manchester232608572555293.123
NLAmsterdam105987359147485.584
DERuhrgebiet281101158879402.095
BEBruxelles / Brussel123348757057594.636
DEKöln89675756828536.347
UKLeeds / Bradford90866754342495.988
NLRotterdam86039552473746.19
FRParis890017247149520.5310

Share link

Anyone who has the link will be able to view this.