My Table looks like this.
Id | Name | Ref |From
10 | Ant | 100 | A
10 | Ant | 300 | A
2 | Cat | 90 | A
2 | Cat | 500 | A
3 | Bird | 150 | A
This is the result I want.
Id | Name | Ref | From
3 | Bird | 150 | A
2 | Cat | 500 | A
10 | Ant | 300 | A
My target is the highest Ref. Could you please tell me about how to write a sql query using pl/sql.