Skip to content

Instantly share code, notes, and snippets.

@kiddojazz
Created June 27, 2023 08:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kiddojazz/adba4d13ece36e03307a200959753386 to your computer and use it in GitHub Desktop.
Save kiddojazz/adba4d13ece36e03307a200959753386 to your computer and use it in GitHub Desktop.
select * from(
select customer_id, state_, profit_total,
rank() over(partition by state_ order by profit_total desc) as Rank_row
from customer_order_window) as rank_info
where rank_row = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment