How can I create a column that has ranked the information of the table based on two or three keys? For example, in this table the rank variable is based on Department and Name:
Dep | Name | Rank 
----+------+------
 1  | Jeff |  1
 1  | Jeff |  2
 1  | Paul |  1
 2  | Nick |  1
 2  | Nick |  2
I have found this solution but it's in SQL and I don't think it applies to my case as all information is in one table and the responses seem to SELECT and JOIN combine information from different tables. Thank you in advance
 
    