I have table like followed by
ID Cust_ID Amount
1 1 10
2 1 20
3 2 30
4 2 40
5 3 50
and I need the latest record of Cust_Id result like followed by
ID Cust_Id Amount
2 1 20
4 2 40
5 3 50
And I tried the Query like this
Select Top 1 *Id,Cust_Id,Amount from tablename
Group by Cust_Id
Order by Id desc