SELECT
  product,
  value,
  RANK() OVER (PARTITION BY product ORDER BY value DESC) AS ranking,
  NTILE(100) OVER (PARTITION BY product ORDER BY value DESC) AS percentile_rank
FROM
  dataset.table
ORDER BY
  1, 2, 3, 4
おすすめの記事