Skip to content

Instantly share code, notes, and snippets.

@log4code
Created April 12, 2019 18:02
Show Gist options
  • Save log4code/f5b867adad375c4b90bbdddb4d913b1f to your computer and use it in GitHub Desktop.
Save log4code/f5b867adad375c4b90bbdddb4d913b1f to your computer and use it in GitHub Desktop.
SELECT
company_name,
sale_date,
total_amount,
ROW_NUMBER() OVER(PARTITION BY company_id ORDER BY total_amount DESC) AS day_rank
FROM
company_sales
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment