I have a select query where i need to remove or subtract two rows and keep the latest chargeID for the same patid initially i used in my where condtion 
e.g

```
 where transactiontype!=void and transactiontype='charges'.

```

I need to keep the latest 'charges' row.
below is the table [![table name tranMaster](https://i.stack.imgur.com/QAnFJ.jpg)](https://i.stack.imgur.com/QAnFJ.jpg)