How to add rank column?
问题 I would like to select records and determine rank number for each similar data. My data is as follows. MEMBER ID | LOAN AMOUNT 1 | 2,000.00 2 | 1,000.00 3 | 4,000.00 4 | 1,000.00 The result I wanted is shown below. RANK|MEMBER ID|LOAN AMOUNT 1 |3 |4,000.00 2 |1 |2,000.00 3 |2 |1,000.00 3 |4 |1,000.00 RANK is a new column. I am using MS SQL server 2008 and created a view table as shown below but it does not resulting to what is wanted. select rank=count(*), s1.MemberID, s1.Loan_Amount from