Day 4: Advance SQL For Data Science | by Sunita Rawat | Jan, 2023 – Medium

RANK() OVER (
[PARTITION BY partition_expression, ... ]
ORDER BY sort_expression [ASC | DESC], ...
)
  • In PARTITION BY clause, it divides the rows of the result set partitions to which the rank() function is applied.
  • In ORDER BY The clause specifies whether the row needs to be sorted into asc/dec order of the rows for each partition to which the Rank() function is applied.

This is the Employee Table with Name and Salary.

Source: https://news.google.com/__i/rss/rd/articles/CBMiUGh0dHBzOi8vbWVkaXVtLmNvbS9Ac3VuaXRhX3Jhd2F0L2RheS00LWFkdmFuY2Utc3FsLWZvci1kYXRhLXNjaWVuY2UtMTMwNDc2NDA4ZTIw0gEA?oc=5

Leave a Reply

Your email address will not be published. Required fields are marked *